|
@@ -3477,10 +3477,9 @@ void CPathfinder::calculatePaths()
|
|
remains = moveAtNextTile - cost;
|
|
remains = moveAtNextTile - cost;
|
|
}
|
|
}
|
|
|
|
|
|
- if((dp->turns==0xff //we haven't been here before
|
|
|
|
|
|
+ if(dp->turns==0xff //we haven't been here before
|
|
|| dp->turns > turnAtNextTile
|
|
|| dp->turns > turnAtNextTile
|
|
|| (dp->turns >= turnAtNextTile && dp->moveRemains < remains)) //this route is faster
|
|
|| (dp->turns >= turnAtNextTile && dp->moveRemains < remains)) //this route is faster
|
|
- && (!isSourceGuarded() || isDestinationGuardian())) // Can step into tile of guard
|
|
|
|
{
|
|
{
|
|
assert(dp != cp->theNodeBefore); //two tiles can't point to each other
|
|
assert(dp != cp->theNodeBefore); //two tiles can't point to each other
|
|
dp->moveRemains = remains;
|
|
dp->moveRemains = remains;
|
|
@@ -3596,6 +3595,9 @@ bool CPathfinder::isMovementPossible()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(isSourceGuarded() && !isDestinationGuardian()) // Can step into tile of guard
|
|
|
|
+ return false;
|
|
|
|
+
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|