From 98160512b8b9d8418fe65865d90ad93d416d7e83 Mon Sep 17 00:00:00 2001 From: dnqbob Date: Wed, 18 Oct 2023 10:05:51 +0800 Subject: [PATCH] Fix LeavesTrails add effect at where actor removed --- OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs index 255c534897..1e9a28a17f 100644 --- a/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs +++ b/OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits.Render public override object Create(ActorInitializer init) { return new LeavesTrails(this); } } - public class LeavesTrails : ConditionalTrait, ITick + public class LeavesTrails : ConditionalTrait, ITick, INotifyAddedToWorld { BodyOrientation body; IFacing facing; @@ -156,5 +156,10 @@ namespace OpenRA.Mods.Common.Traits.Render { cachedPosition = self.CenterPosition; } + + void INotifyAddedToWorld.AddedToWorld(Actor self) + { + cachedPosition = self.CenterPosition; + } } }