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) { }
@@ -48,14 +48,26 @@ namespace OpenRA.Mods.RA
});
}
public void Selling(Actor self)
{
DisableGps();
}
public void Sold(Actor self) { }
public void Damaged(Actor self, AttackInfo e)
{
if (e.DamageState == DamageState.Dead)
{
DisableGps();
}
}
void DisableGps()
{
Granted = false;
RefreshGps(self);
}
}
void RefreshGps(Actor self)
{