INotifyCreated.Created now calls base properly

This commit is contained in:
Markus Hartung
2017-06-02 00:29:19 +02:00
committed by reaperrr
parent f7ddb969c6
commit 2a0b3b39ea
5 changed files with 15 additions and 5 deletions

View File

@@ -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<AttackBase>();
base.Created(self);
}
void INotifyBurstComplete.FiredBurst(Actor self, Target target, Armament a)

View File

@@ -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<PlayerResources>();
base.Created(self);
}
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)

View File

@@ -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<ConditionManager>();
@@ -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; } }

View File

@@ -478,9 +478,11 @@ namespace OpenRA.Mods.Common.Traits
SetVisualPosition(self, init.Get<CenterPositionInit, WPos>());
}
void INotifyCreated.Created(Actor self)
protected override void Created(Actor self)
{
conditionManager = self.TraitOrDefault<ConditionManager>();
base.Created(self);
}
// Returns a valid sub-cell

View File

@@ -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<ConditionManager>();
base.Created(self);
}
float ISelectionBar.GetValue()