Sfoglia il codice sorgente

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.
Arseniy Shestakov 9 anni fa
parent
commit
6985e96f0d
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      server/CGameHandler.cpp

+ 2 - 1
server/CGameHandler.cpp

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