Show error message instead of aborting when loading an invalid map size.

This commit is contained in:
Jonathan G Rennison
2015-09-12 13:33:35 +01:00
parent 1891e7dfc8
commit f27ca88596
3 changed files with 24 additions and 7 deletions

View File

@@ -37,6 +37,9 @@ static void Save_MAPS()
static void Load_MAPS()
{
SlGlobList(_map_dimensions);
if (!ValidateMapSize(_map_dim_x, _map_dim_y)) {
SlErrorCorruptFmt("Invalid map size: %u x %u", _map_dim_x, _map_dim_y);
}
AllocateMap(_map_dim_x, _map_dim_y);
}