Fix crash when trying to render an empty stamp
Empty stamps are those whose block width or height is 0. While they are technically valid and certain parts of the game are prepared to handle them, others aren't, so it's safest to just adjust the definition of valid stamps to exclude empty ones.
This commit is contained in:
parent
827bb568de
commit
6ff385d92d
@ -646,6 +646,9 @@ void GameSave::readOPS(char * data, int dataLength)
|
||||
if (inputData[5] != CELL)
|
||||
throw ParseException(ParseException::InvalidDimensions, "Incorrect CELL size");
|
||||
|
||||
if (blockW <= 0 || blockH <= 0)
|
||||
throw ParseException(ParseException::InvalidDimensions, "Save too small");
|
||||
|
||||
//Too large/off screen
|
||||
if (blockX+blockW > XRES/CELL || blockY+blockH > YRES/CELL)
|
||||
throw ParseException(ParseException::InvalidDimensions, "Save too large");
|
||||
|
Loading…
Reference in New Issue
Block a user