From 607d9b2d5c8b83f031f5c5ae071f0694d3511b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 30 May 2020 17:40:57 +0200 Subject: [PATCH] Fix index out of bounds exception for off world aircraft. --- OpenRA.Game/Map/Map.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index 0302819fad..050fa07d1e 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -853,6 +853,9 @@ namespace OpenRA var cell = CellContaining(pos); var offset = pos - CenterOfCell(cell); + if (!Ramp.Contains(cell)) + return new WDist(offset.Z); + var ramp = Ramp[cell]; if (ramp != 0) {