fixed 2 crashes

This commit is contained in:
EternalRat
2021-06-20 18:23:21 +02:00
parent 7f96c61504
commit 950684b84f
+4
View File
@@ -362,6 +362,8 @@ namespace BBM {
int block = 0;
if (!Utils::tryParse(blockType, block))
throw (ParserError("Couldn't parse block type."));
if (block < 0 || block > 7)
throw (ParserError("Couldn't parse block type."));
return (static_cast<MapGenerator::BlockType>(block));
}
@@ -372,6 +374,8 @@ namespace BBM {
int bonus = 0;
if (!Utils::tryParse(bonusType, bonus))
throw (ParserError("Couldn't parse bonus type."));
if (bonus < 0 || bonus > 4)
throw (ParserError("Couldn't parse bonus type."));
return (static_cast<Bonus::BonusType>(bonus));
}