Skip to content
Permalink
Browse files

pathfinding - the real reason skynet hasn't taken over

  • Loading branch information
Warboy1982 committed Mar 18, 2018
1 parent ca35d77 commit 1b4c1c77eb47a2ae44a2f84f605564e182945ed7
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Battlescape/Pathfinding.cpp
@@ -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));

0 comments on commit 1b4c1c7

Please sign in to comment.
You can’t perform that action at this time.