1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Added range checks to values read from h3m.

Fixes reading of morale/luck values (-3..3) as unsigned leading to
overflow.
This commit is contained in:
Ivan Savenko
2024-02-05 21:27:55 +02:00
parent 4af4d1a75e
commit 87059be67b
13 changed files with 154 additions and 141 deletions

View File

@ -117,7 +117,7 @@ void CMapHeader::setupEvents()
}
CMapHeader::CMapHeader() : version(EMapFormat::VCMI), height(72), width(72),
twoLevel(true), difficulty(1), levelLimit(0), howManyTeams(0), areAnyPlayers(false)
twoLevel(true), difficulty(EMapDifficulty::NORMAL), levelLimit(0), howManyTeams(0), areAnyPlayers(false)
{
setupEvents();
allowedHeroes = VLC->heroh->getDefaultAllowed();