From 7964f77f279053eb74692fdc71219c87758dd4e0 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:55:14 +0200 Subject: [PATCH] fix dragon utopia --- lib/mapObjects/CBank.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/mapObjects/CBank.cpp b/lib/mapObjects/CBank.cpp index 739add296..bd5d1af68 100644 --- a/lib/mapObjects/CBank.cpp +++ b/lib/mapObjects/CBank.cpp @@ -275,6 +275,10 @@ void CBank::doVisit(const CGHeroInstance * hero) const //grant resources if (bankConfig) { + // add statistics + if(ID.toEnum() == Obj::DRAGON_UTOPIA) + cb->gameState()->statistic.accumulatedValues[hero->getOwner()].lastRansackingDragonUtopiaDay = cb->gameState()->getDate(Date::DAY); + for (GameResID it : GameResID::ALL_RESOURCES()) { if (bankConfig->resources[it] != 0) @@ -383,13 +387,6 @@ void CBank::doVisit(const CGHeroInstance * hero) const } cb->setObjPropertyValue(id, ObjProperty::BANK_CLEAR); //bc = nullptr } - - // add statistics - if(bankConfig) - { - if(ID.toEnum() == Obj::DRAGON_UTOPIA) - cb->gameState()->statistic.accumulatedValues[hero->getOwner()].lastRansackingDragonUtopiaDay = cb->gameState()->getDate(Date::DAY); - } } void CBank::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const