瀏覽代碼

Fix calculating of total cost if hero has non-max amount of points

Ivan Savenko 6 月之前
父節點
當前提交
e0adbb3237
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      client/adventureMap/AdventureMapInterface.cpp

+ 2 - 2
client/adventureMap/AdventureMapInterface.cpp

@@ -779,8 +779,8 @@ void AdventureMapInterface::showMoveDetailsInStatusbar(const CGHeroInstance & he
 	const int movementPointsLastTurnCost = maxMovementPointsAtStartOfLastTurn - pathNode.moveRemains;
 	const int remainingPointsAfterMove = pathNode.moveRemains;
 
-	int totalMovementCost = 0;
-	for (int i = 0; i <= pathNode.turns; ++i)
+	int totalMovementCost = hero.movementPointsRemaining();
+	for (int i = 1; i <= pathNode.turns; ++i)
 	{
 		auto turnInfo = hero.getTurnInfo(i);
 		if (pathNode.layer == EPathfindingLayer::SAIL)