From 3f0126eef4fa6bdc09846c36d647b0c05b5c2375 Mon Sep 17 00:00:00 2001 From: michaeldgg2 <119738087+michaeldgg2@users.noreply.github.com> Date: Sat, 26 Jul 2025 20:02:34 +0200 Subject: [PATCH] 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. --- OpenRA.Mods.Common/Traits/World/ResourceLayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs b/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs index 16d7cbd0d6..e37e5222bb 100644 --- a/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs @@ -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().TerrainTypes.Contains(cellTerrainType)); + return BuildingInfluence.GetBuildingsAt(cell).All(a => a.Info.TraitInfo().TerrainTypes.Contains(resourceInfo.TerrainType)); } ResourceLayerContents CreateResourceCell(string resourceType, CPos cell, int density)