mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fix auto-visit of configurable objects on new day
This commit is contained in:
@@ -553,14 +553,6 @@ void CGTownInstance::newTurn(vstd::RNG & rand) const
|
||||
for(const auto * manaVortex : getBonusingBuildings(BuildingSubID::MANA_VORTEX))
|
||||
cb->setObjPropertyValue(id, ObjProperty::STRUCTURE_CLEAR_VISITORS, manaVortex->indexOnTV); //reset visitors for Mana Vortex
|
||||
|
||||
//get Mana Vortex or Stables bonuses
|
||||
//same code is in the CGameHandler::buildStructure method
|
||||
if (garrisonHero != nullptr) //garrison hero first - consistent with original H3 Mana Vortex and Battle Scholar Academy levelup windows order
|
||||
cb->visitCastleObjects(this, garrisonHero);
|
||||
|
||||
if (visitingHero != nullptr)
|
||||
cb->visitCastleObjects(this, visitingHero);
|
||||
|
||||
if (tempOwner == PlayerColor::NEUTRAL) //garrison growth for neutral towns
|
||||
{
|
||||
std::vector<SlotID> nativeCrits; //slots
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user