Fix LeavesTrails add effect at where actor removed

This commit is contained in:
dnqbob
2023-10-18 10:05:51 +08:00
committed by Gustas
parent 9a235f2256
commit 98160512b8

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new LeavesTrails(this); } public override object Create(ActorInitializer init) { return new LeavesTrails(this); }
} }
public class LeavesTrails : ConditionalTrait<LeavesTrailsInfo>, ITick public class LeavesTrails : ConditionalTrait<LeavesTrailsInfo>, ITick, INotifyAddedToWorld
{ {
BodyOrientation body; BodyOrientation body;
IFacing facing; IFacing facing;
@@ -156,5 +156,10 @@ namespace OpenRA.Mods.Common.Traits.Render
{ {
cachedPosition = self.CenterPosition; cachedPosition = self.CenterPosition;
} }
void INotifyAddedToWorld.AddedToWorld(Actor self)
{
cachedPosition = self.CenterPosition;
}
} }
} }