Fix Concrete placement on invalid terrain.
This commit is contained in:
@@ -93,7 +93,8 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
|
|||||||
// Fill the footprint with random variants
|
// Fill the footprint with random variants
|
||||||
foreach (var c in info.Tiles(self.Location))
|
foreach (var c in info.Tiles(self.Location))
|
||||||
{
|
{
|
||||||
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
|
// Only place on allowed terrain types
|
||||||
|
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue || !info.TerrainTypes.Contains(map.GetTerrainInfo(c).Type))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't place under other buildings (or their bib)
|
// Don't place under other buildings (or their bib)
|
||||||
@@ -109,7 +110,9 @@ namespace OpenRA.Mods.D2k.Traits.Buildings
|
|||||||
for (var i = 0; i < template.TilesCount; i++)
|
for (var i = 0; i < template.TilesCount; i++)
|
||||||
{
|
{
|
||||||
var c = self.Location + new CVec(i % template.Size.X, i / template.Size.X);
|
var c = self.Location + new CVec(i % template.Size.X, i / template.Size.X);
|
||||||
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue)
|
|
||||||
|
// Only place on allowed terrain types
|
||||||
|
if (!map.Contains(c) || map.CustomTerrain[c] != byte.MaxValue || !info.TerrainTypes.Contains(map.GetTerrainInfo(c).Type))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't place under other buildings (or their bib)
|
// Don't place under other buildings (or their bib)
|
||||||
|
|||||||
Reference in New Issue
Block a user