1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Moved mana and movement points refresh to NewTurnProcessor

This commit is contained in:
Ivan Savenko
2024-08-25 21:35:32 +00:00
parent c09c414f5a
commit 10a9d777c7
5 changed files with 77 additions and 62 deletions

View File

@@ -1901,18 +1901,11 @@ void NewTurn::applyGs(CGameState *gs)
gs->globalEffects.reduceBonusDurations(Bonus::OneWeek);
//TODO not really a single root hierarchy, what about bonuses placed elsewhere? [not an issue with H3 mechanics but in the future...]
for(const NewTurn::Hero & h : heroes) //give mana/movement point
{
CGHeroInstance *hero = gs->getHero(h.id);
if(!hero)
{
logGlobal->error("Hero %d not found in NewTurn::applyGs", h.id.getNum());
continue;
}
for(const auto & manaPack : heroesMana)
manaPack.applyGs(gs);
hero->setMovementPoints(h.move);
hero->mana = h.mana;
}
for(const auto & movePack : heroesMovement)
movePack.applyGs(gs);
gs->heroesPool->onNewDay();