Fix height calculations in custom terrain layers.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user