Skip to content

Commit

Permalink
pathfinding - the real reason skynet hasn't taken over
Browse files Browse the repository at this point in the history
  • Loading branch information
Warboy1982 committed Mar 18, 2018
1 parent ca35d77 commit 1b4c1c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Battlescape/Pathfinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ int Pathfinding::getTUCost(Position startPosition, int direction, Position *endP
Position verticalOffset (0, 0, 0);

// if we are on a stairs try to go up a level
if (direction < DIR_UP && startTile->getTerrainLevel() <= -16 && aboveDestination && !aboveDestination->hasNoFloor(destinationTile) && !triedStairs)
if (direction < DIR_UP && startTile->getTerrainLevel() <= -16 && aboveDestination && !aboveDestination->hasNoFloor(destinationTile))
{
numberOfPartsGoingUp++;
verticalOffset.z++;

if (numberOfPartsGoingUp > size)
if (!triedStairs)
{
verticalOffset.z++;
endPosition->z++;
destinationTile = _save->getTile(*endPosition + offset);
belowDestination = _save->getTile(*endPosition + Position(x,y,-1));
Expand Down

0 comments on commit 1b4c1c7

Please sign in to comment.