Fix various map generator bounds and size related issues

- If generating a RectangularIsometric map via lobby, make the height
  twice the width so that the map is approximately world-square.
- Use equal top and bottom cordons for RectangularIsometric maps.
- Change some map bounds checking.
- Check that actors are at least partially inside map.Contains before
  placing. (To avoid frozen actor crashes.)
- Fix editor generated map blitting for RectangularIsometric.
This commit is contained in:
Ashley Newson
2025-11-09 00:05:21 +00:00
committed by Gustas Kažukauskas
parent 915ad36ddc
commit 91ddfd6fc1
4 changed files with 36 additions and 11 deletions

View File

@@ -234,9 +234,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void RandomizeSize()
{
var mapGrid = modData.Manifest.Get<MapGrid>();
var sizeRange = MapSizes[selectedSize];
var width = Game.CosmeticRandom.Next(sizeRange.X, sizeRange.Y);
size = new Size(width + 2, width + 2);
var height =
mapGrid.Type == MapGridType.RectangularIsometric
? width * 2
: width;
size = new Size(width + 2, height + mapGrid.MaximumTerrainHeight * 2 + 2);
}
void RefreshSettings()