mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 22:00:24 +07:00
Fix map setTransients throwing exception from map generator on some map sizes (#5084)
This commit is contained in:
@ -367,8 +367,8 @@ class TileMap {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Yes the map generator calls this repeatedly, and we don't want to end up with an oversized tileMatrix
|
// Yes the map generator calls this repeatedly, and we don't want to end up with an oversized tileMatrix
|
||||||
// rightX is -leftX or -leftX + 1
|
// rightX is -leftX or -leftX + 1 or -leftX + 2
|
||||||
if (tileMatrix.size != 1 - 2 * leftX && tileMatrix.size != 2 - 2 * leftX)
|
if (tileMatrix.size !in (1 - 2 * leftX)..(3 - 2 * leftX))
|
||||||
throw(IllegalStateException("TileMap.setTransients called on existing tileMatrix of different size"))
|
throw(IllegalStateException("TileMap.setTransients called on existing tileMatrix of different size"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user