mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix crash on exporting maps for translation
This commit is contained in:
@@ -410,9 +410,11 @@ bool MapReaderH3M::readBool()
|
||||
int8_t MapReaderH3M::readInt8Checked(int8_t lowerLimit, int8_t upperLimit)
|
||||
{
|
||||
int8_t result = readInt8();
|
||||
assert(result >= lowerLimit);
|
||||
assert(result <= upperLimit);
|
||||
return std::clamp(result, lowerLimit, upperLimit);
|
||||
int8_t resultClamped = std::clamp(result, lowerLimit, upperLimit);
|
||||
if (result != resultClamped)
|
||||
logGlobal->warn("Map contains out of range value %d! Expected %d-%d", static_cast<int>(result), static_cast<int>(lowerLimit), static_cast<int>(upperLimit));
|
||||
|
||||
return resultClamped;
|
||||
}
|
||||
|
||||
uint8_t MapReaderH3M::readUInt8()
|
||||
|
||||
Reference in New Issue
Block a user