From 6795fb6967e1028e9227116d91cd5362cc123135 Mon Sep 17 00:00:00 2001 From: teinarss Date: Wed, 28 Aug 2019 22:13:30 +0200 Subject: [PATCH] GetAvailableSubCell should block cells outside the map --- OpenRA.Mods.Common/Traits/World/Locomotor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/World/Locomotor.cs b/OpenRA.Mods.Common/Traits/World/Locomotor.cs index 3dc20aba7e..320e348d2a 100644 --- a/OpenRA.Mods.Common/Traits/World/Locomotor.cs +++ b/OpenRA.Mods.Common/Traits/World/Locomotor.cs @@ -298,8 +298,7 @@ namespace OpenRA.Mods.Common.Traits public SubCell GetAvailableSubCell(Actor self, CPos cell, SubCell preferredSubCell = SubCell.Any, Actor ignoreActor = null, CellConditions check = CellConditions.All) { - var cost = cellsCost[cell]; - if (cost == short.MaxValue) + if (MovementCostForCell(cell) == short.MaxValue) return SubCell.Invalid; if (check.HasCellCondition(CellConditions.TransientActors))