Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
YOU'RE TEARING ME APART, PATHFINDER
- Loading branch information
Showing
with
2 additions
and
2 deletions.
-
+2
−2
src/Battlescape/Pathfinding.cpp
|
@@ -309,10 +309,10 @@ int Pathfinding::getTUCost(Position startPosition, int direction, Position *endP |
|
|
if (direction < DIR_UP && startTile->getTerrainLevel() <= -16 && aboveDestination && !aboveDestination->hasNoFloor(destinationTile) && !triedStairs) |
|
|
{ |
|
|
numberOfPartsGoingUp++; |
|
|
verticalOffset.z++; |
|
|
|
|
|
if (numberOfPartsGoingUp > size) |
|
|
{ |
|
|
verticalOffset.z++; |
|
|
endPosition->z++; |
|
|
destinationTile = _save->getTile(*endPosition + offset); |
|
|
belowDestination = _save->getTile(*endPosition + Position(x,y,-1)); |
|
@@ -344,7 +344,7 @@ int Pathfinding::getTUCost(Position startPosition, int direction, Position *endP |
|
|
if (!destinationTile) |
|
|
return 255; |
|
|
|
|
|
if (direction < DIR_UP && endPosition->z == startTile->getPosition().z && numberOfPartsGoingUp == 0) |
|
|
if (direction < DIR_UP && endPosition->z == startTile->getPosition().z) |
|
|
{ |
|
|
// check if we can go this way |
|
|
if (isBlocked(startTile, destinationTile, direction, target)) |
|
|