Skip to content

Commit

Permalink
fix pathfinding, take 148
Browse files Browse the repository at this point in the history
  • Loading branch information
Warboy1982 committed Aug 26, 2015
1 parent 527f2c8 commit 2f2f51c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Battlescape/Pathfinding.cpp
Expand Up @@ -268,15 +268,14 @@ int Pathfinding::getTUCost(const Position &startPosition, int direction, Positio
{
Position offset = Position (x, y, 0);
Tile *startTile = _save->getTile(startPosition + offset);
Tile *belowStartTile = _save->getTile(startPosition + offset + Position(0,0,-1));
Tile *destinationTile = _save->getTile(*endPosition + offset);
Tile *belowDestination = _save->getTile(*endPosition + offset + Position(0,0,-1));
Tile *aboveDestination = _save->getTile(*endPosition + offset + Position(0,0,1));

// this means the destination is probably outside the map
if (startTile == 0 || destinationTile == 0)
return 255;
if (!x && !y && _movementType != MT_FLY && canFallDown(startTile, size))
if (!x && !y && _movementType != MT_FLY && canFallDown(startTile, size+1))
{
if (direction != DIR_DOWN)
{
Expand Down

0 comments on commit 2f2f51c

Please sign in to comment.