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

@@ -471,8 +471,10 @@ namespace OpenRA.Mods.Common.Traits
var position = cell.Layer == 0 ? self.World.Map.CenterOfCell(cell) :
self.World.GetCustomMovementLayers()[cell.Layer].CenterOfCell(cell);
var subcellOffset = self.World.Map.Grid.OffsetOfSubCell(subCell);
SetCenterPosition(self, position + subcellOffset);
position += self.World.Map.Grid.OffsetOfSubCell(subCell);
position -= new WVec(0, 0, self.World.Map.DistanceAboveTerrain(position).Length);
SetCenterPosition(self, position);
FinishedMoving(self);
}