Bug Fix: Selling ATEK loses GPS

This commit is contained in:
Mike Bundy
2011-04-03 02:13:07 +01:00
committed by Chris Forbes
parent 1af23079eb
commit e544333d9e

View File

@@ -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, INotifyStanceChanged
class GpsPower : SupportPower, INotifyDamage, ISync, INotifyStanceChanged, INotifySold
{
public GpsPower(Actor self, GpsPowerInfo info) : base(self, info) { }
@@ -46,15 +46,27 @@ namespace OpenRA.Mods.RA
w.Add(new DelayedAction((Info as GpsPowerInfo).RevealDelay * 25,
() => { Granted = true; RefreshGps(self); }));
});
}
}
public void Selling(Actor self)
{
DisableGps();
}
public void Sold(Actor self) { }
public void Damaged(Actor self, AttackInfo e)
{
if (e.DamageState == DamageState.Dead)
{
Granted = false;
RefreshGps(self);
{
DisableGps();
}
}
void DisableGps()
{
Granted = false;
RefreshGps(self);
}
void RefreshGps(Actor self)