Fix FallsToEarth queueing an activity in its ctor
This commit is contained in:
@@ -42,18 +42,24 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class FallsToEarth : IEffectiveOwner
|
||||
public class FallsToEarth : IEffectiveOwner, INotifyCreated
|
||||
{
|
||||
readonly FallsToEarthInfo info;
|
||||
readonly Player effectiveOwner;
|
||||
|
||||
public FallsToEarth(ActorInitializer init, FallsToEarthInfo info)
|
||||
{
|
||||
init.Self.QueueActivity(false, new FallToEarth(init.Self, info));
|
||||
this.info = info;
|
||||
effectiveOwner = init.Contains<EffectiveOwnerInit>() ? init.Get<EffectiveOwnerInit, Player>() : init.Self.Owner;
|
||||
}
|
||||
|
||||
// We return init.Self.Owner if there's no effective owner
|
||||
bool IEffectiveOwner.Disguised { get { return true; } }
|
||||
Player IEffectiveOwner.Owner { get { return effectiveOwner; } }
|
||||
|
||||
void INotifyCreated.Created(Actor self)
|
||||
{
|
||||
self.QueueActivity(false, new FallToEarth(self, info));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user