Skip to content

Commit

Permalink
YOU'RE TEARING ME APART, PATHFINDER
Browse files Browse the repository at this point in the history
  • Loading branch information
Warboy1982 committed Mar 11, 2018
1 parent d2394dd commit 330c218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Battlescape/Pathfinding.cpp
Expand Up @@ -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));
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 330c218

Please sign in to comment.