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