1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Reduce usage of implicit conversions to int

This commit is contained in:
Ivan Savenko
2025-04-19 16:12:07 +03:00
parent 4d57a8ed36
commit 829739da24
64 changed files with 220 additions and 200 deletions

View File

@ -315,14 +315,14 @@ void PlayerLocalState::serialize(JsonNode & dest) const
for (auto const * town : ownedTowns)
{
JsonNode record;
record["id"].Integer() = town->id;
record["id"].Integer() = town->id.getNum();
dest["towns"].Vector().push_back(record);
}
for (auto const * hero : wanderingHeroes)
{
JsonNode record;
record["id"].Integer() = hero->id;
record["id"].Integer() = hero->id.getNum();
if (vstd::contains(sleepingHeroes, hero))
record["sleeping"].Bool() = true;
@ -340,7 +340,7 @@ void PlayerLocalState::serialize(JsonNode & dest) const
dest["spellbook"]["tabAdvmap"].Integer() = spellbookSettings.spellbookLastTabAdvmap;
if (currentSelection)
dest["currentSelection"].Integer() = currentSelection->id;
dest["currentSelection"].Integer() = currentSelection->id.getNum();
}
void PlayerLocalState::deserialize(const JsonNode & source)