Prevent concrete from spawning underneath already placed building bibs.
This is the equivalent to reverting 83b61ab.
This commit is contained in:
@@ -57,6 +57,7 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
|
|||||||
int damageThreshold;
|
int damageThreshold;
|
||||||
int damageTicks;
|
int damageTicks;
|
||||||
TechTree techTree;
|
TechTree techTree;
|
||||||
|
BuildingInfluence bi;
|
||||||
|
|
||||||
public D2kBuilding(ActorInitializer init, D2kBuildingInfo info)
|
public D2kBuilding(ActorInitializer init, D2kBuildingInfo info)
|
||||||
: base(init, info)
|
: base(init, info)
|
||||||
@@ -68,6 +69,7 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
|
|||||||
{
|
{
|
||||||
health = self.TraitOrDefault<IHealth>();
|
health = self.TraitOrDefault<IHealth>();
|
||||||
layer = self.World.WorldActor.TraitOrDefault<BuildableTerrainLayer>();
|
layer = self.World.WorldActor.TraitOrDefault<BuildableTerrainLayer>();
|
||||||
|
bi = self.World.WorldActor.Trait<BuildingInfluence>();
|
||||||
techTree = self.Owner.PlayerActor.TraitOrDefault<TechTree>();
|
techTree = self.Owner.PlayerActor.TraitOrDefault<TechTree>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +89,8 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
|
|||||||
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
|
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't place under other buildings
|
// Don't place under other buildings (or their bib)
|
||||||
if (self.World.ActorMap.GetActorsAt(c).Any(a => a != self && a.TraitOrDefault<Building>() != null))
|
if (bi.GetBuildingAt(c) != self)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var index = Game.CosmeticRandom.Next(template.TilesCount);
|
var index = Game.CosmeticRandom.Next(template.TilesCount);
|
||||||
@@ -103,8 +105,8 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
|
|||||||
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
|
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't place under other buildings
|
// Don't place under other buildings (or their bib)
|
||||||
if (self.World.ActorMap.GetActorsAt(c).Any(a => a != self && a.TraitOrDefault<Building>() != null))
|
if (bi.GetBuildingAt(c) != self)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
layer.AddTile(c, new TerrainTile(template.Id, (byte)i));
|
layer.AddTile(c, new TerrainTile(template.Id, (byte)i));
|
||||||
|
|||||||
Reference in New Issue
Block a user