Fix height calculations in custom terrain layers.

This commit is contained in:
Paul Chote
2017-09-17 08:47:26 +00:00
committed by reaperrr
parent c3ece99796
commit f4c2b36778
4 changed files with 19 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ namespace OpenRA.Mods.Common.Traits
map = self.World.Map;
terrainIndex = self.World.Map.Rules.TileSet.GetTerrainIndex(info.TerrainType);
height = new CellLayer<int>(map);
var cellHeight = self.World.Map.CellHeightStep.Length;
foreach (var c in map.AllCells)
{
var neighbourCount = 0;
@@ -57,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
height[c] = info.HeightOffset.Length + neighbourHeight * 512 / neighbourCount;
height[c] = info.HeightOffset.Length + neighbourHeight * cellHeight / neighbourCount;
}
}