mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-05 02:49:57 +00:00
fixed 2 crashes
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user