Fix map rendering (#8514)

* Fix negative grids

* Map renderer: skip, and warn on empty grids.

* Fix local transform
This commit is contained in:
wrexbe
2022-05-28 22:57:37 -07:00
committed by GitHub
parent 941c47aae5
commit 5f94c8d57a
3 changed files with 11 additions and 4 deletions

View File

@@ -111,6 +111,13 @@ namespace Content.MapRenderer.Painters
foreach (var grid in grids)
{
// Skip empty grids
if (grid.LocalAABB.IsEmpty())
{
Console.WriteLine($"Warning: Grid {grid.Index} was empty. Skipping image rendering.");
continue;;
}
var tileXSize = grid.TileSize * TilePainter.TileImageSize;
var tileYSize = grid.TileSize * TilePainter.TileImageSize;