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:
committed by
Gustas Kažukauskas
parent
5f51dec9f9
commit
3f0126eef4
@@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!resourceInfo.AllowedTerrainTypes.Contains(cellTerrainType))
|
if (!resourceInfo.AllowedTerrainTypes.Contains(cellTerrainType))
|
||||||
return false;
|
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)
|
ResourceLayerContents CreateResourceCell(string resourceType, CPos cell, int density)
|
||||||
|
|||||||
Reference in New Issue
Block a user