diff --git a/dat/opthelp b/dat/opthelp index b241ab670..80140b410 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -211,9 +211,10 @@ packorder a list of default symbols for kinds of [")[%?+!=/(*`0_] some other things) gets shown if the 'sortpack' option is on (If you specify only some kinds of items, the others from the default order will be appended to the end.) -paranoid_confirmation space separated list [paranoid_confirmation:pray] +paranoid_confirmation space separated list [paranoid_confirm:pray swim] of situations where alternate prompting is desired - Confirm -- when requiring "yes", also require "no" to reject + Confirm -- when requiring "yes", also require "no" to reject; + also requires yes rather than y for pray, Autoall quit -- yes vs y to confirm quitting or to enter explore mode die -- yes vs y to confirm dying (for explore or debug mode) bones -- yes vs y to confirm saving bones data in debug mode @@ -223,10 +224,10 @@ paranoid_confirmation space separated list [paranoid_confirmation:pray] Were-change -- yes vs y to confirm changing form due to lycanthropy when hero has polymorph control; pray -- y to confirm an attempt to pray; on by default - swim -- y to confirm an attempt to move into water or lava - when hero can see it and isn't impaired; on by default + swim -- require m prefix to move into water or lava when + hero has seen it and isn't impaired; on by default; AutoAll -- y to confirm if using menustyle:Full and choice 'A' - in the object class filtering menu is selected + in the object class filtering menu is selected; Remove -- always pick from inventory for 'R' and 'T' even when wearing just one applicable item to remove or take off pickup_burden when you pick up an item that exceeds this encumbrance [S] diff --git a/src/pickup.c b/src/pickup.c index 063d5be68..98a254589 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1361,7 +1361,11 @@ query_category( for (i = 0; i < n; ++i) if ((*pick_list)[i].item.a_int == 'A') { - if (y_n("Really autoselect All?") != 'y') { + /* ParanoidAutoAll is set (otherwise verify_All is false); + if ParanoidConfirm is also set, require "yes" rather than + just "y" to accept (and "no" rather than "n" to decline) */ + if (paranoid_query(ParanoidConfirm, + "Really autoselect All?")) { /* answer is "no", so take 'A' out of the list; if it is the only entry, we'll return nothing, otherwise go on to next menu without autoselect */ diff --git a/src/pray.c b/src/pray.c index b8231a300..6d12477ca 100644 --- a/src/pray.c +++ b/src/pray.c @@ -2057,14 +2057,24 @@ pray_revive(void) int dopray(void) { + boolean ok; + /* * If ParanoidPray is set, confirm prayer to avoid accidental slips - * of Alt+p. - * YN(): don't save response in do-again buffer since if it is 'y', - * ^A would bypass confirmation, or if 'n', ^A would be pointless. + * of Alt+p. If ParanoidConfirm is also set, require "yes" rather + * than just "y" (will also require "no" to decline). */ - if (ParanoidPray && YN("Are you sure you want to pray?") != 'y') - return ECMD_OK; + if (ParanoidPray) { + ok = paranoid_query(ParanoidConfirm, "Are you sure you want to pray?"); + + /* clear command recall buffer; otherwise ^A to repeat p(ray) would + do so without confirmation (if 'ok') or do nothing (if '!ok') */ + cmdq_clear(CQ_REPEAT); + cmdq_add_ec(CQ_REPEAT, dopray); + + if (!ok) /* declined the "are you sure?" confirmation */ + return ECMD_OK; + } if (!u.uconduct.gnostic++) /* breaking conduct should probably occur in can_pray() at @@ -2085,7 +2095,16 @@ dopray(void) from the do-again buffer, so need to suppress this response too; otherwise subsequent ^A would use this answer for "are you sure?" and bypass confirmation */ - if ((ParanoidPray ? YN(forcesuccess) : y_n(forcesuccess)) == 'y') { + if (ParanoidPray) { + boolean save_doagain = gi.in_doagain; + + gi.in_doagain = FALSE; + ok = (YN(forcesuccess) == 'y'); + gi.in_doagain = save_doagain; + } else { + ok = (y_n(forcesuccess) == 'y'); + } + if (ok) { u.ublesscnt = 0; if (u.uluck < 0) u.uluck = 0;