From 7c4e2a06716ffc65ca9d5365bd1992130372da0b Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 28 Jul 2020 19:48:21 +0900 Subject: [PATCH] [Refactor] #40571 Separated menu_target() from target_set() --- src/target/target-setter.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/target/target-setter.c b/src/target/target-setter.c index 118c17203..4c8aad1a2 100644 --- a/src/target/target-setter.c +++ b/src/target/target-setter.c @@ -140,6 +140,15 @@ static void describe_projectablity(player_type *creature_ptr, ts_type *ts_ptr) strcat(ts_ptr->info, cheatinfo); } +static void menu_target(ts_type *ts_ptr) +{ + if (!use_menu) + return; + + if (ts_ptr->query == '\r') + ts_ptr->query = 't'; +} + /* * Handle "target" and "look". */ @@ -159,12 +168,8 @@ bool target_set(player_type *creature_ptr, target_type mode) break; } + menu_target(ts_ptr); int d = 0; - if (use_menu) { - if (ts_ptr->query == '\r') - ts_ptr->query = 't'; - } - switch (ts_ptr->query) { case ESCAPE: case 'q': { -- 2.11.0