mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
CGameHandler::newTurn: use next day TurnInfo to set correct hero MP
This hotfix actually fix issue 2083, but in future we need to rework new turn code anyway. See issue 2356.
This commit is contained in:
@@ -1331,7 +1331,8 @@ void CGameHandler::newTurn()
|
||||
|
||||
NewTurn::Hero hth;
|
||||
hth.id = h->id;
|
||||
hth.move = h->maxMovePoints(gs->map->getTile(h->getPosition(false)).terType != ETerrainType::WATER);
|
||||
// TODO: this code executed when bonuses of previous day not yet updated (this happen in NewTurn::applyGs). See issue 2356
|
||||
hth.move = h->maxMovePoints(gs->map->getTile(h->getPosition(false)).terType != ETerrainType::WATER, new TurnInfo(h, 1));
|
||||
|
||||
if(h->visitedTown && h->visitedTown->hasBuilt(BuildingID::MAGES_GUILD_1)) //if hero starts turn in town with mage guild
|
||||
hth.mana = std::max(h->mana, h->manaLimit()); //restore all mana
|
||||
|
Reference in New Issue
Block a user