From 82589a60dd1359c3e1138c3afa0059b07eddb375 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sun, 18 Nov 2007 12:26:06 +0000 Subject: [PATCH] Do not skip auto-walk code if player tries to walk in invalid direction (fixes issue #254) SVN-Revision: 5184 --- src/worldmap/tux.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/worldmap/tux.cpp b/src/worldmap/tux.cpp index b4ea3f70a..b81fb626f 100644 --- a/src/worldmap/tux.cpp +++ b/src/worldmap/tux.cpp @@ -218,11 +218,9 @@ Tux::tryContinueWalking(float elapsed_time) // if user wants to change direction, try changing, else guess the direction in which to walk next const int tile_data = worldmap->tile_data_at(tile_pos); - if (direction != input_direction) { - if(canWalk(tile_data, input_direction)) { - direction = input_direction; - back_direction = reverse_dir(direction); - } + if ((direction != input_direction) && canWalk(tile_data, input_direction)) { + direction = input_direction; + back_direction = reverse_dir(direction); } else { Direction dir = D_NONE; if (tile_data & Tile::WORLDMAP_NORTH && back_direction != D_NORTH) -- 2.11.0