Fix the check in AllowResourceAt() method of the ResourceLayer class

This fixes incorrect check in AllowResourceAt(), which previously looked at terrain type of the given cell *before* resource was created. Hence the check did not work as expected.
This commit is contained in:
michaeldgg2
2025-07-26 20:02:34 +02:00
committed by Gustas Kažukauskas
parent 5f51dec9f9
commit 3f0126eef4

View File

@@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Traits
if (!resourceInfo.AllowedTerrainTypes.Contains(cellTerrainType))
return false;
return BuildingInfluence.GetBuildingsAt(cell).All(a => a.Info.TraitInfo<BuildingInfo>().TerrainTypes.Contains(cellTerrainType));
return BuildingInfluence.GetBuildingsAt(cell).All(a => a.Info.TraitInfo<BuildingInfo>().TerrainTypes.Contains(resourceInfo.TerrainType));
}
ResourceLayerContents CreateResourceCell(string resourceType, CPos cell, int density)