1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #3946 from dydzio0614/mana-vortex-hero-order

Fix "bonusing" town building visiting hero order
This commit is contained in:
Ivan Savenko 2024-05-11 21:58:23 +03:00 committed by GitHub
commit 9049fb738a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -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<SlotID> nativeCrits; //slots

View File

@ -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;