Skip to content

Commit c4a7072

Browse files
committed
Fix direction bug in internalMoveCreature
1 parent 87e4465 commit c4a7072

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/game.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,10 @@ ReturnValue Game::internalMoveCreature(Creature& creature, Tile& toTile, uint32_
867867
const Position& fromPosition = fromCylinder->getPosition();
868868
const Position& toPosition = toCylinder->getPosition();
869869
if (fromPosition.z != toPosition.z && (fromPosition.x != toPosition.x || fromPosition.y != toPosition.y)) {
870-
internalCreatureTurn(&creature, getDirectionTo(fromPosition, toPosition));
870+
Direction dir = getDirectionTo(fromPosition, toPosition);
871+
if ((dir & DIRECTION_DIAGONAL_MASK) == 0) {
872+
internalCreatureTurn(&creature, dir);
873+
}
871874
}
872875
}
873876

0 commit comments

Comments
 (0)