1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +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

@@ -64,10 +64,10 @@ enum class EMarketMode : int8_t
enum class EAiTactic : int8_t
{
NONE = -1,
RANDOM,
WARRIOR,
BUILDER,
EXPLORER
RANDOM = 0,
WARRIOR = 1,
BUILDER = 2,
EXPLORER = 3
};
enum class EBuildingState : int8_t