1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix auto-visit of configurable objects on new day

This commit is contained in:
Ivan Savenko
2024-08-12 13:30:03 +00:00
parent 162535e6d8
commit 19838e2654
2 changed files with 13 additions and 10 deletions

View File

@@ -631,10 +631,21 @@ void CGameHandler::onPlayerTurnStarted(PlayerColor which)
events::PlayerGotTurn::defaultExecute(serverEventBus.get(), which);
turnTimerHandler->onPlayerGetTurn(which);
handleTimeEvents(which);
const auto * playerState = gs->getPlayerState(which);
for (auto t : getPlayerState(which)->towns)
handleTimeEvents(which);
for (auto t : playerState->towns)
handleTownEvents(t);
for (auto t : playerState->towns)
{
//garrison hero first - consistent with original H3 Mana Vortex and Battle Scholar Academy levelup windows order
if (t->garrisonHero != nullptr)
objectVisited(t, t->garrisonHero);
if (t->visitingHero != nullptr)
objectVisited(t, t->visitingHero);
}
}
void CGameHandler::onPlayerTurnEnded(PlayerColor which)