Move maximum terrain height definition to mod.yaml.
This commit is contained in:
@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
continue;
|
||||
|
||||
mapTiles[c] = new TerrainTile(Template, index);
|
||||
mapHeight[c] = (byte)(baseHeight + template[index].Height).Clamp(0, world.TileSet.MaxGroundHeight);
|
||||
mapHeight[c] = (byte)(baseHeight + template[index].Height).Clamp(0, map.MaximumTerrainHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,11 +60,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
width = Math.Max(2, width);
|
||||
height = Math.Max(2, height);
|
||||
|
||||
var maxTerrainHeight = Game.ModData.Manifest.MaximumTerrainHeight;
|
||||
var tileset = modRules.TileSets[tilesetDropDown.Text];
|
||||
var map = new Map(tileset, width + 2, height + tileset.MaxGroundHeight + 2);
|
||||
var map = new Map(tileset, width + 2, height + maxTerrainHeight + 2);
|
||||
|
||||
var tl = new MPos(1, 1);
|
||||
var br = new MPos(width, height + tileset.MaxGroundHeight);
|
||||
var br = new MPos(width, height + maxTerrainHeight);
|
||||
map.SetBounds(tl, br);
|
||||
|
||||
map.PlayerDefinitions = new MapPlayers(map.Rules, map.SpawnPoints.Value.Length).ToMiniYaml();
|
||||
|
||||
Reference in New Issue
Block a user