Remove the hard-coded ban of placing buildings on resources.
This commit is contained in:
committed by
atlimit8
parent
9faf9aa1b9
commit
c5139fb6c2
@@ -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;
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user