diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index f8aa94516..2fec8e6ea 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1572 $ $NHDT-Date: 1762577372 2025/11/07 20:49:32 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1573 $ $NHDT-Date: 1762680996 2025/11/09 01:36:36 $ General Fixes and Modified Features ----------------------------------- @@ -2137,6 +2137,9 @@ timer sanity check for melting ice gave false complaint about non-ice for mhitm_ad_phys() was not applying Half_physical_damage when hero was target throwing crystal plate mail or helm of brilliance up against the ceiling could result in the item being cracked and then vanishing +yn_function (used all over the place) sometimes triggered an impossible() + during do-again (^A) processing [ongoing revisions; more are probably + needed; listed here in case ^A behavior changes] Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/cmd.c b/src/cmd.c index cd82e234d..780bca6c3 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 cmd.c $NHDT-Date: 1736401574 2025/01/08 21:46:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.744 $ */ +/* NetHack 3.7 cmd.c $NHDT-Date: 1762680996 2025/11/09 01:36:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.755 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -5260,7 +5260,7 @@ yn_function( query = qbuf; } - if ((cmdq = cmdq_pop()) != 0) { + if (addcmdq && (cmdq = cmdq_pop()) != 0) { cq = *cmdq; free(cmdq); } else { @@ -5323,7 +5323,7 @@ yn_function( it is most likely caused by saving a keystroke that was just used to answer a context-sensitive prompt, then using the do-again command with context that has changed */ - if (resp && res && !strchr(resp, res)) { + if (resp && *resp && res && !strchr(resp, res)) { /* this probably needs refinement since caller is expecting something within 'resp' and ESC won't be (it could be present, but as a flag for unshown possibilities rather than as acceptable input) */ @@ -5405,9 +5405,11 @@ paranoid_ynq( /* for empty input, return value c will already be 'n' */ } while (ParanoidConfirm && strcmpi(ans, "no") && --trylimit); } else if (accept_q) { - c = ynq(prompt); /* 'y', 'n', or 'q' */ + /* 'y', 'n', or 'q' */ + c = yn_function(prompt, ynqchars, 'n', FALSE); } else { - c = y_n(prompt); /* 'y' or 'n' */ + /* 'y' or 'n' */ + c = yn_function(prompt, ynchars, 'n', FALSE); } if (c != 'y' && (c != 'q' || !accept_q)) c = 'n'; diff --git a/src/invent.c b/src/invent.c index 37b23a87f..bd8c689c9 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 invent.c $NHDT-Date: 1737384766 2025/01/20 06:52:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.531 $ */ +/* NetHack 3.7 invent.c $NHDT-Date: 1762680996 2025/11/09 01:36:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.543 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2445,8 +2445,11 @@ askchain( ininv ? safeq_xprname : doname, ininv ? safeq_shortxprname : ansimpleoname, "item"); - sym = (takeoff || ident || otmp->quan < 2L) ? nyaq(qbuf) - : nyNaq(qbuf); + /* nyaq(qbuf) or nyNaq(qbuf), bypassing canned input for ^A */ + sym = yn_function(qbuf, + (takeoff || ident || otmp->quan < 2L) + ? ynaqchars : ynNaqchars, + 'n', FALSE); } else sym = 'y'; diff --git a/src/pray.c b/src/pray.c index 6250505ee..5f00487d1 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 pray.c $NHDT-Date: 1727250729 2024/09/25 07:52:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.220 $ */ +/* NetHack 3.7 pray.c $NHDT-Date: 1762680996 2025/11/09 01:36:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.244 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2207,12 +2207,12 @@ dopray(void) if (ParanoidPray) { ok = paranoid_query(ParanoidConfirm, "Are you sure you want to pray?"); - +#if 0 /* 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); - +#endif if (!ok) /* declined the "are you sure?" confirmation */ return ECMD_OK; }