Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LeavesTrails add effect at where actor removed. #21141

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
}
}
}
4 changes: 1 addition & 3 deletions mods/ts/rules/gdi-vehicles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ HVR:
RequiresCondition: !empdisable
BobDistance: -64
InitialHeight: 384
Carryable:
CarriedCondition: carried
LeavesTrails:
RequiresCondition: !inside-tunnel && !carried
RequiresCondition: !inside-tunnel
Image: wake
Palette: effect
TerrainTypes: Water
Expand Down