From a12806195802fc1eeed5d8036d6e94670bffb1b8 Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 28 Jul 2020 20:35:00 +0900 Subject: [PATCH] [Fix] #40571 Declared queried_command in switch_target_input() --- src/target/target-setter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/target/target-setter.c b/src/target/target-setter.c index 64f0b08f4..ac293fab5 100644 --- a/src/target/target-setter.c +++ b/src/target/target-setter.c @@ -213,8 +213,9 @@ static void switch_target_input(player_type *creature_ptr, ts_type *ts_ptr) return; case 'm': return; - default: - if (ts_ptr->query != rogue_like_commands ? 'x' : 'l') { + default: { + const char queried_command = rogue_like_commands ? 'x' : 'l'; + if (ts_ptr->query != queried_command) { ts_ptr->distance = get_keymap_dir(ts_ptr->query); if (ts_ptr->distance == 0) bell(); @@ -231,6 +232,7 @@ static void switch_target_input(player_type *creature_ptr, ts_type *ts_ptr) return; } + } } static bool check_panel_changed(player_type *creature_ptr, ts_type *ts_ptr) -- 2.11.0