Răsfoiți Sursa

Fix off-by-one error - turnLimit 1 should work after 1st turn, not 2nd

Ivan Savenko 1 an în urmă
părinte
comite
75aae66858
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      lib/pathfinder/CPathfinder.cpp

+ 2 - 2
lib/pathfinder/CPathfinder.cpp

@@ -143,13 +143,13 @@ void CPathfinder::calculatePaths()
 		auto * hlp = config->getOrCreatePathfinderHelper(source, gamestate);
 
 		hlp->updateTurnInfo(turn);
-		if(!movement)
+		if(movement == 0)
 		{
 			hlp->updateTurnInfo(++turn);
 			movement = hlp->getMaxMovePoints(source.node->layer);
 			if(!hlp->passOneTurnLimitCheck(source))
 				continue;
-			if(turn >= hlp->options.turnLimit)
+			if(turn > hlp->options.turnLimit)
 				continue;
 		}