Use INotifyOwnerChanged for updating internal references.

This commit is contained in:
Paul Chote
2014-10-13 19:43:11 +13:00
parent 8508fc5155
commit a08a3a3869
12 changed files with 45 additions and 33 deletions

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Infiltration
public object Create(ActorInitializer init) { return new InfiltrateForPowerOutage(init.self, this); }
}
class InfiltrateForPowerOutage : INotifyCapture, INotifyInfiltrated
class InfiltrateForPowerOutage : INotifyOwnerChanged, INotifyInfiltrated
{
readonly InfiltrateForPowerOutageInfo info;
PowerManager playerPower;
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Infiltration
playerPower.TriggerPowerOutage(info.Duration);
}
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{
playerPower = self.Owner.PlayerActor.Trait<PowerManager>();
}