1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Replaced vstd clamp with std version

This commit is contained in:
Ivan Savenko
2023-04-11 01:00:46 +03:00
parent 5f74aca341
commit 506c3d29bc
11 changed files with 26 additions and 47 deletions

View File

@@ -66,15 +66,14 @@ void CCreGenAsCastleInfo::serializeJson(JsonSerializeFormat & handler)
void CCreGenLeveledInfo::serializeJson(JsonSerializeFormat & handler)
{
handler.serializeInt("minLevel", minLevel, static_cast<ui8>(1));
handler.serializeInt("maxLevel", maxLevel, static_cast<ui8>(7));
handler.serializeInt("minLevel", minLevel, static_cast<uint8_t>(1));
handler.serializeInt("maxLevel", maxLevel, static_cast<uint8_t>(7));
if(!handler.saving)
{
//todo: safely allow any level > 7
vstd::amax(minLevel, 1);
vstd::amin(minLevel, 7);
vstd::abetween(maxLevel, minLevel, 7);
vstd::abetween<uint8_t>(minLevel, 1, 7);
vstd::abetween<uint8_t>(maxLevel, minLevel, 7);
}
}