mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
AI pathfinding: bug fix after refactoring
This commit is contained in:
parent
83aae7d72b
commit
cbaa834589
@ -282,12 +282,12 @@ void CPathfinder::calculatePaths()
|
||||
if(!hlp->isLayerAvailable(neighbour->layer))
|
||||
continue;
|
||||
|
||||
/// Check transition without tile accessability rules
|
||||
if(source.node->layer != neighbour->layer && !isLayerTransitionPossible(neighbour->layer))
|
||||
continue;
|
||||
|
||||
destination.setNode(gs, neighbour);
|
||||
|
||||
/// Check transition without tile accessability rules
|
||||
if(source.node->layer != neighbour->layer && !isLayerTransitionPossible())
|
||||
continue;
|
||||
|
||||
destination.turn = turn;
|
||||
destination.movementLeft = movement;
|
||||
|
||||
@ -428,8 +428,10 @@ bool CPathfinder::isPatrolMovementAllowed(const int3 & dst) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPathfinder::isLayerTransitionPossible(const ELayer destLayer) const
|
||||
bool CPathfinder::isLayerTransitionPossible() const
|
||||
{
|
||||
ELayer destLayer = destination.node->layer;
|
||||
|
||||
/// No layer transition allowed when previous node action is BATTLE
|
||||
if(source.node->action == CGPathNode::BATTLE)
|
||||
return false;
|
||||
|
@ -390,7 +390,7 @@ private:
|
||||
bool isHeroPatrolLocked() const;
|
||||
bool isPatrolMovementAllowed(const int3 & dst) const;
|
||||
|
||||
bool isLayerTransitionPossible(const ELayer dstLayer) const;
|
||||
bool isLayerTransitionPossible() const;
|
||||
CGPathNode::ENodeAction getTeleportDestAction() const;
|
||||
|
||||
bool isSourceInitialPosition() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user