Bug Fix: GPS is shared across owned ATEKs
This commit is contained in:
@@ -24,11 +24,15 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
class GpsPower : SupportPower, INotifyKilled, ISync, INotifyStanceChanged, INotifySold
|
||||
{
|
||||
public GpsPower(Actor self, GpsPowerInfo info) : base(self, info) { }
|
||||
|
||||
[Sync]
|
||||
public bool Granted;
|
||||
|
||||
public GpsPower(Actor self, GpsPowerInfo info) : base(self, info)
|
||||
{
|
||||
Granted = self.World.ActorsWithTrait<GpsPower>()
|
||||
.Any(p => p.Actor.Owner == self.Owner && p.Trait.Granted);
|
||||
}
|
||||
|
||||
public override void Charged(Actor self, string key)
|
||||
{
|
||||
self.Owner.PlayerActor.Trait<SupportPowerManager>().Powers[key].Activate(new Order());
|
||||
@@ -44,7 +48,17 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
/* there is only one shroud, but it is misleadingly available through Player.Shroud */
|
||||
w.Add(new DelayedAction((Info as GpsPowerInfo).RevealDelay * 25,
|
||||
() => { Granted = true; RefreshGps(self); }));
|
||||
() => {
|
||||
var ateks = self.World.ActorsWithTrait<GpsPower>();
|
||||
foreach (TraitPair<GpsPower> i in ateks)
|
||||
{
|
||||
if (i.Actor.Owner == self.Owner)
|
||||
{
|
||||
i.Trait.Granted = true;
|
||||
}
|
||||
}
|
||||
RefreshGps(self);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user