1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

PlayerState now stores all objects owned by player

This commit is contained in:
Ivan Savenko
2024-08-24 22:21:26 +00:00
parent 0fd9dbf240
commit a481f07daf
21 changed files with 184 additions and 113 deletions

View File

@@ -710,11 +710,11 @@ bool PlayerMessageProcessor::handleCheatCode(const std::string & cheat, PlayerCo
executeCheatCode(cheatName, i.first, ObjectInstanceID::NONE, parameters);
if (vstd::contains(townTargetedCheats, cheatName))
for (const auto & t : i.second.towns)
for (const auto & t : i.second.getTowns())
executeCheatCode(cheatName, i.first, t->id, parameters);
if (vstd::contains(heroTargetedCheats, cheatName))
for (const auto & h : i.second.heroes)
for (const auto & h : i.second.getHeroes())
executeCheatCode(cheatName, i.first, h->id, parameters);
}