Fix crash in TSEditorResourceLayer when adding resources.

Ensure cells are within map bounds when checking if adjacent cells should be cleared during resource placement.
This commit is contained in:
RoosterDragon
2022-03-26 14:48:44 +00:00
committed by abcdefg30
parent e685731b33
commit ea243b8558

View File

@@ -99,6 +99,9 @@ namespace OpenRA.Mods.Cnc.Traits
var resourceIsVeins = resourceType == info.VeinType;
foreach (var c in Common.Util.ExpandFootprint(cell, false))
{
if (!Map.Resources.Contains(c))
continue;
var resourceIndex = Map.Resources[c].Type;
if (resourceIndex == 0 || !ResourceTypesByIndex.TryGetValue(resourceIndex, out var neighourResourceType))
neighourResourceType = null;