Skip to content

Commit

Permalink
Land activity: fix bug which causes crash in Aircraft.AddInflunce()
Browse files Browse the repository at this point in the history
Fixes #21302
  • Loading branch information
michaeldgg2 committed Feb 18, 2024
1 parent a054d21 commit 4986ed0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Mods.Common/Activities/Air/Land.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public override bool Tick(Actor self)
target = Target.FromCell(self.World, newLocation.Value);
targetPosition = target.CenterPosition + offset;
landingCell = self.World.Map.CellContaining(targetPosition);

// Since the landing cell have changed, check again; if we are already at the new landing location, then abort landing
if ((targetPosition - pos).LengthSquared == 0)
return true;
}
}

Expand Down

0 comments on commit 4986ed0

Please sign in to comment.