From acea19312d1e3cfcb0b95fd03208ef25c102ab0e Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 5 Oct 2019 16:56:35 +0200 Subject: [PATCH] Fix FallsToEarth queueing an activity in its ctor --- OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs index c72aabb41d..401111b681 100644 --- a/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs +++ b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs @@ -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() ? init.Get() : 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)); + } } }