Rewrite UpgradeManager implementation to suit conditions.
This commit is contained in:
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override object Create(ActorInitializer init) { return new Targetable(init.Self, this); }
|
||||
}
|
||||
|
||||
public class Targetable : UpgradableTrait<TargetableInfo>, ITargetable, INotifyCreated
|
||||
public class Targetable : UpgradableTrait<TargetableInfo>, ITargetable
|
||||
{
|
||||
protected static readonly string[] None = new string[] { };
|
||||
protected Cloak[] cloaks;
|
||||
@@ -35,9 +35,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public Targetable(Actor self, TargetableInfo info)
|
||||
: base(info) { }
|
||||
|
||||
void INotifyCreated.Created(Actor self)
|
||||
protected override void Created(Actor self)
|
||||
{
|
||||
cloaks = self.TraitsImplementing<Cloak>().ToArray();
|
||||
|
||||
base.Created(self);
|
||||
}
|
||||
|
||||
public virtual bool TargetableBy(Actor self, Actor viewer)
|
||||
|
||||
Reference in New Issue
Block a user