From 9916e4c4ac1f737199dd8aba5c61d4ce99d18d05 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Fri, 5 Nov 2021 17:47:09 +0100 Subject: [PATCH] Fix a crash in the TSEditorResourceLayer neighbour validation --- OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs b/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs index e5a3834047..496b3a6a28 100644 --- a/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs +++ b/OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs @@ -42,6 +42,9 @@ namespace OpenRA.Mods.Cnc.Traits bool IsValidVeinNeighbour(CPos cell, CPos neighbour) { + if (!Map.Contains(neighbour)) + return false; + // Cell is automatically valid if it contains a veinhole actor if (actorLayer.PreviewsAt(neighbour).Any(a => info.VeinholeActors.Contains(a.Info.Name))) return true;