浏览代码

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 年之前
父节点
当前提交
6985e96f0d
共有 1 个文件被更改,包括 2 次插入1 次删除
  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