From b8a5750529190a36218395ac06989626b2af6621 Mon Sep 17 00:00:00 2001 From: teinarss Date: Mon, 11 May 2020 17:44:09 +0200 Subject: [PATCH] Add map.contains check to CanStayInCell --- OpenRA.Mods.Common/Traits/World/Locomotor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/World/Locomotor.cs b/OpenRA.Mods.Common/Traits/World/Locomotor.cs index e1d2e84b8e..8502527ef8 100644 --- a/OpenRA.Mods.Common/Traits/World/Locomotor.cs +++ b/OpenRA.Mods.Common/Traits/World/Locomotor.cs @@ -312,6 +312,9 @@ namespace OpenRA.Mods.Common.Traits public bool CanStayInCell(CPos cell) { + if (!world.Map.Contains(cell)) + return false; + return !GetCache(cell).CellFlag.HasCellFlag(CellFlag.HasTransitOnlyActor); }