Browse Source

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

Ivan Savenko 6 months ago
parent
commit
e0adbb3237
1 changed files with 2 additions and 2 deletions
  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 movementPointsLastTurnCost = maxMovementPointsAtStartOfLastTurn - pathNode.moveRemains;
 	const int remainingPointsAfterMove = 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);
 		auto turnInfo = hero.getTurnInfo(i);
 		if (pathNode.layer == EPathfindingLayer::SAIL)
 		if (pathNode.layer == EPathfindingLayer::SAIL)