mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Add turn limit option to pathfinder
This commit is contained in:
parent
56074e18a9
commit
c8a96647c3
@ -121,6 +121,8 @@ void CPathfinder::calculatePaths()
|
|||||||
movement = hlp->getMaxMovePoints(source.node->layer);
|
movement = hlp->getMaxMovePoints(source.node->layer);
|
||||||
if(!hlp->passOneTurnLimitCheck(source))
|
if(!hlp->passOneTurnLimitCheck(source))
|
||||||
continue;
|
continue;
|
||||||
|
if(turn >= hlp->options.turnLimit)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
source.isInitialPosition = source.nodeHero == hlp->hero;
|
source.isInitialPosition = source.nodeHero == hlp->hero;
|
||||||
|
@ -30,6 +30,7 @@ PathfinderOptions::PathfinderOptions()
|
|||||||
, lightweightFlyingMode(false)
|
, lightweightFlyingMode(false)
|
||||||
, oneTurnSpecialLayersLimit(true)
|
, oneTurnSpecialLayersLimit(true)
|
||||||
, originalMovementRules(false)
|
, originalMovementRules(false)
|
||||||
|
, turnLimit(std::numeric_limits<uint8_t>::max())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +68,9 @@ struct DLL_LINKAGE PathfinderOptions
|
|||||||
/// I find it's reasonable limitation, but it's will make some movements more expensive than in H3.
|
/// I find it's reasonable limitation, but it's will make some movements more expensive than in H3.
|
||||||
bool originalMovementRules;
|
bool originalMovementRules;
|
||||||
|
|
||||||
|
/// Max number of turns to compute. Default = infinite
|
||||||
|
uint8_t turnLimit;
|
||||||
|
|
||||||
PathfinderOptions();
|
PathfinderOptions();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user