From 32aaac1dc2257138dea318527d3012b5d4f763fe Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 16 Aug 2022 20:04:19 +0100 Subject: [PATCH] HierarchicalPathFinder.PathExists checks the locations are in map bounds. Without this, passing locations outside the map could cause a crash instead of reporting no path. --- OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs b/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs index ba066942cc..8b629d7c6c 100644 --- a/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs +++ b/OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs @@ -749,6 +749,9 @@ namespace OpenRA.Mods.Common.Pathfinder if (costEstimator == null) return false; + if (!world.Map.Contains(source) || !world.Map.Contains(target)) + return false; + RebuildDomains(); var sourceGridInfo = gridInfos[GridIndex(source)];