Fix a crash in the TSEditorResourceLayer neighbour validation

This commit is contained in:
abcdefg30
2021-11-05 17:47:09 +01:00
committed by reaperrr
parent 31cec0c17f
commit 9916e4c4ac

View File

@@ -42,6 +42,9 @@ namespace OpenRA.Mods.Cnc.Traits
bool IsValidVeinNeighbour(CPos cell, CPos neighbour) bool IsValidVeinNeighbour(CPos cell, CPos neighbour)
{ {
if (!Map.Contains(neighbour))
return false;
// Cell is automatically valid if it contains a veinhole actor // Cell is automatically valid if it contains a veinhole actor
if (actorLayer.PreviewsAt(neighbour).Any(a => info.VeinholeActors.Contains(a.Info.Name))) if (actorLayer.PreviewsAt(neighbour).Any(a => info.VeinholeActors.Contains(a.Info.Name)))
return true; return true;