Remove the hard-coded ban of placing buildings on resources.

This commit is contained in:
Matthias Mailänder
2020-03-23 22:51:51 +01:00
committed by atlimit8
parent 9faf9aa1b9
commit c5139fb6c2
2 changed files with 4 additions and 2 deletions

View File

@@ -46,6 +46,8 @@ namespace OpenRA.Mods.Common.Traits
public readonly bool AllowInvalidPlacement = false;
public readonly bool AllowPlacementOnResources = false;
[Desc("Clear smudges from underneath the building footprint.")]
public readonly bool RemoveSmudgesOnBuild = true;

View File

@@ -55,8 +55,8 @@ namespace OpenRA.Mods.Common.Traits
return true;
var res = world.WorldActor.TraitOrDefault<ResourceLayer>();
return bi.Tiles(cell).All(
t => world.Map.Contains(t) && (res == null || res.GetResourceType(t) == null) &&
return bi.Tiles(cell).All(t => world.Map.Contains(t) &&
(bi.AllowPlacementOnResources || res == null || res.GetResourceType(t) == null) &&
world.IsCellBuildable(t, ai, bi, toIgnore));
}