Skip to content

Commit

Permalink
Fix LeavesTrails add effect at where actor removed
Browse files Browse the repository at this point in the history
  • Loading branch information
dnqbob authored and PunkPun committed Oct 21, 2023
1 parent 9a235f2 commit 9816051
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OpenRA.Mods.Common/Traits/Render/LeavesTrails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class LeavesTrailsInfo : ConditionalTraitInfo
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;
IFacing facing;
Expand Down Expand Up @@ -156,5 +156,10 @@ protected override void TraitEnabled(Actor self)
{
cachedPosition = self.CenterPosition;
}

void INotifyAddedToWorld.AddedToWorld(Actor self)
{
cachedPosition = self.CenterPosition;
}
}
}

0 comments on commit 9816051

Please sign in to comment.