From caaa527d457154601f932dd6ddfd916aa749b9b8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 20 Aug 2022 17:09:17 +0300 Subject: [PATCH] Fix some #saveoptions issues The #name default key was 'N', but that gets bound to #runsoutheast when not using number_pad. Swap around the default #name key to M-n, and bind the 'N' to it in commands_init instead. The number_pad option wasn't getting saved because it has a separate handler - mark the option as changed even if the value did not change so it will be saved to the config. --- src/cmd.c | 4 ++-- src/options.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 261c970a0..6e859a769 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2565,7 +2565,7 @@ struct ext_func_tab extcmdlist[] = { #endif { M('m'), "monster", "use monster's special ability", domonability, IFBURIED | AUTOCOMPLETE, NULL }, - { 'N', "name", "same as call; name a monster or object or object type", + { M('n'), "name", "same as call; name a monster or object or object type", docallcmd, IFBURIED | AUTOCOMPLETE, NULL }, { M('o'), "offer", "offer a sacrifice to the gods", dosacrifice, AUTOCOMPLETE | CMD_M_PREFIX, NULL }, @@ -3231,6 +3231,7 @@ commands_init(void) (void) bind_key('k', "kick"); (void) bind_key('l', "loot"); (void) bind_key(C('n'), "annotate"); + (void) bind_key('N', "name"); (void) bind_key('u', "untrap"); (void) bind_key('5', "run"); (void) bind_key(M('5'), "rush"); @@ -3239,7 +3240,6 @@ commands_init(void) /* alt keys: */ (void) bind_key(M('O'), "overview"); (void) bind_key(M('2'), "twoweapon"); - (void) bind_key(M('n'), "name"); (void) bind_key(M('N'), "name"); #if 0 /* don't do this until the rest_on_space option is set or cleared */ diff --git a/src/options.c b/src/options.c index 7563acf12..70cae4439 100644 --- a/src/options.c +++ b/src/options.c @@ -8003,6 +8003,8 @@ doset_simple(void) reslt = (*allopt[k].optfn)(allopt[k].idx, do_handler, FALSE, empty_optstr, empty_optstr); + if (reslt == optn_ok) + got_from_config[k] = TRUE; } else { char abuf[BUFSZ];