1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

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

This commit is contained in:
Ivan Savenko 2024-04-26 12:44:42 +03:00
parent c524648c7b
commit 75aae66858

View File

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