mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +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:
@@ -434,7 +434,7 @@ void CMapGenerator::addHeaderInfo()
|
||||
m.twoLevel = mapGenOptions.getHasTwoLevels();
|
||||
m.name.appendLocalString(EMetaText::GENERAL_TXT, 740);
|
||||
m.description.appendRawString(getMapDescription());
|
||||
m.difficulty = 1;
|
||||
m.difficulty = EMapDifficulty::NORMAL;
|
||||
addPlayerInfo();
|
||||
m.waterMap = (mapGenOptions.getWaterContent() != EWaterContent::EWaterContent::NONE);
|
||||
m.banWaterContent();
|
||||
|
||||
Reference in New Issue
Block a user