From f20ef4f1b34c333662dad333ad2233e9ec537caf Mon Sep 17 00:00:00 2001 From: Dydzio Date: Sat, 11 May 2024 20:21:02 +0200 Subject: [PATCH] Fix hero order for giving bonuses in town to match H3. --- lib/mapObjects/CGTownInstance.cpp | 6 +++--- server/CGameHandler.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index 0c18b5f6f..71784c48e 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -544,12 +544,12 @@ void CGTownInstance::newTurn(CRandomGenerator & rand) const //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 (garrisonHero != nullptr) - cb->visitCastleObjects(this, garrisonHero); - if (tempOwner == PlayerColor::NEUTRAL) //garrison growth for neutral towns { std::vector nativeCrits; //slots diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 62b3fcb58..1b187cb43 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2434,10 +2434,10 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID, // now when everything is built - reveal tiles for lookout tower changeFogOfWar(t->getSightCenter(), t->getSightRadius(), t->getOwner(), ETileVisibility::REVEALED); + if(t->garrisonHero) //garrison hero first - consistent with original H3 Mana Vortex and Battle Scholar Academy levelup windows order + visitCastleObjects(t, t->garrisonHero); if(t->visitingHero) visitCastleObjects(t, t->visitingHero); - if(t->garrisonHero) - visitCastleObjects(t, t->garrisonHero); checkVictoryLossConditionsForPlayer(t->tempOwner); return true;