diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs index 2373665b29..7ee2024986 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/AttackOrderPower.cs @@ -47,9 +47,11 @@ namespace OpenRA.Mods.Cnc.Traits attack.AttackTarget(Target.FromCell(self.World, order.TargetLocation), false, false, true); } - void INotifyCreated.Created(Actor self) + protected override void Created(Actor self) { attack = self.Trait(); + + base.Created(self); } void INotifyBurstComplete.FiredBurst(Actor self, Target target, Armament a) diff --git a/OpenRA.Mods.Common/Traits/CashTrickler.cs b/OpenRA.Mods.Common/Traits/CashTrickler.cs index 34df31a95a..8b3db44561 100644 --- a/OpenRA.Mods.Common/Traits/CashTrickler.cs +++ b/OpenRA.Mods.Common/Traits/CashTrickler.cs @@ -45,9 +45,11 @@ namespace OpenRA.Mods.Common.Traits this.info = info; } - void INotifyCreated.Created(Actor self) + protected override void Created(Actor self) { resources = self.Owner.PlayerActor.Trait(); + + base.Created(self); } void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) diff --git a/OpenRA.Mods.Common/Traits/Cloak.cs b/OpenRA.Mods.Common/Traits/Cloak.cs index 1c6e3ad2a7..1499d2f2e5 100644 --- a/OpenRA.Mods.Common/Traits/Cloak.cs +++ b/OpenRA.Mods.Common/Traits/Cloak.cs @@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits remainingTime = info.InitialDelay; } - void INotifyCreated.Created(Actor self) + protected override void Created(Actor self) { conditionManager = self.TraitOrDefault(); @@ -90,6 +90,8 @@ namespace OpenRA.Mods.Common.Traits if (conditionManager != null && cloakedToken == ConditionManager.InvalidConditionToken && !string.IsNullOrEmpty(Info.CloakedCondition)) cloakedToken = conditionManager.GrantCondition(self, Info.CloakedCondition); } + + base.Created(self); } public bool Cloaked { get { return !IsTraitDisabled && remainingTime <= 0; } } diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 12395a9590..4368cc750c 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -478,9 +478,11 @@ namespace OpenRA.Mods.Common.Traits SetVisualPosition(self, init.Get()); } - void INotifyCreated.Created(Actor self) + protected override void Created(Actor self) { conditionManager = self.TraitOrDefault(); + + base.Created(self); } // Returns a valid sub-cell diff --git a/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs b/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs index 019bbb4adb..582b023edc 100644 --- a/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs +++ b/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs @@ -40,9 +40,11 @@ namespace OpenRA.Mods.Common.Traits protected override void TraitEnabled(Actor self) { UpdateStatus(self); } protected override void TraitDisabled(Actor self) { Revoke(self); } - void INotifyCreated.Created(Actor self) + protected override void Created(Actor self) { conditionManager = self.TraitOrDefault(); + + base.Created(self); } float ISelectionBar.GetValue()