refresh GPS on stance change
This commit is contained in:
@@ -191,7 +191,7 @@ namespace OpenRA.Network
|
||||
w.WorldActor.Trait<Shroud>().UpdatePlayerStance(w, p, oldStance, s);
|
||||
|
||||
foreach (var nsc in w.Queries.WithTrait<INotifyStanceChanged>())
|
||||
nsc.Trait.StanceChanged(p, target, oldStance, s);
|
||||
nsc.Trait.StanceChanged(nsc.Actor, p, target, oldStance, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,5 +229,6 @@ namespace OpenRA.Traits
|
||||
}
|
||||
|
||||
public interface INotifyKeyPress { bool KeyPressed(Actor self, KeyInput e); }
|
||||
public interface INotifyStanceChanged { void StanceChanged(Player a, Player b, Stance oldStance, Stance newStance); }
|
||||
public interface INotifyStanceChanged { void StanceChanged(Actor self, Player a, Player b,
|
||||
Stance oldStance, Stance newStance); }
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA
|
||||
public override object Create(ActorInitializer init) { return new GpsPower(init.self, this); }
|
||||
}
|
||||
|
||||
class GpsPower : SupportPower, INotifyDamage, ISync
|
||||
class GpsPower : SupportPower, INotifyDamage, ISync, INotifyStanceChanged
|
||||
{
|
||||
public GpsPower(Actor self, GpsPowerInfo info) : base(self, info) { }
|
||||
|
||||
@@ -64,5 +64,10 @@ namespace OpenRA.Mods.RA
|
||||
.Any(p => p.Actor.Owner.Stances[self.World.LocalPlayer] == Stance.Ally &&
|
||||
p.Trait.Granted);
|
||||
}
|
||||
|
||||
public void StanceChanged(Actor self, Player a, Player b, Stance oldStance, Stance newStance)
|
||||
{
|
||||
RefreshGps(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user