Fix movement on ramps when moving to subcell

Fix movement on ramps when moving to subcell
This commit is contained in:
Moritz Heller
2024-07-18 13:24:17 +02:00
committed by Gustas
parent bdc142ae51
commit 81bcff0f8a
2 changed files with 11 additions and 3 deletions

View File

@@ -451,7 +451,13 @@ namespace OpenRA.Mods.Common.Activities
if (progress >= Distance)
{
mobile.SetCenterPosition(self, To);
var toPos = To;
// apply ramp offset to ground units
if (MovingOnGroundLayer)
toPos -= new WVec(WDist.Zero, WDist.Zero, self.World.Map.DistanceAboveTerrain(toPos));
mobile.SetCenterPosition(self, toPos);
mobile.Facing = TurnsWhileMoving
? Util.TickFacing(mobile.Facing, ToFacing, mobile.TurnSpeed)
: ToFacing;