Bug Fix: Selling ATEK loses GPS
This commit is contained in:
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public override object Create(ActorInitializer init) { return new GpsPower(init.self, this); }
|
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) { }
|
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,
|
w.Add(new DelayedAction((Info as GpsPowerInfo).RevealDelay * 25,
|
||||||
() => { Granted = true; RefreshGps(self); }));
|
() => { Granted = true; RefreshGps(self); }));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Selling(Actor self)
|
||||||
|
{
|
||||||
|
DisableGps();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Sold(Actor self) { }
|
||||||
|
|
||||||
public void Damaged(Actor self, AttackInfo e)
|
public void Damaged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
if (e.DamageState == DamageState.Dead)
|
if (e.DamageState == DamageState.Dead)
|
||||||
{
|
{
|
||||||
Granted = false;
|
DisableGps();
|
||||||
RefreshGps(self);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisableGps()
|
||||||
|
{
|
||||||
|
Granted = false;
|
||||||
|
RefreshGps(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshGps(Actor self)
|
void RefreshGps(Actor self)
|
||||||
|
|||||||
Reference in New Issue
Block a user