From 18ae35ef39794cd5b320f3836c4af766865f5c7e Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 30 Jun 2019 11:50:08 -0700 Subject: [PATCH 1/3] curses message history vs dumplog message history When I implemented getmsghistory()/putmsghistory() for curses I was assuming that DUMPLOG would only be used with tty, but it is interface neutral and can be used with curses (or others). So curses message history needs to behave like tty message history and be sure to pass along messages that bypass pline() and the normal message window. (Mainly one-line summaries of long quest messages, but also old messages fetched from a save file and available to be re-saved without having been shown if new session doesn't generate enough new messages to flush them.) --- doc/fixes36.3 | 4 +++- win/curses/cursmesg.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index d03090095..261215b97 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.79 $ $NHDT-Date: 1561917056 2019/06/30 17:50:56 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.80 $ $NHDT-Date: 1561920590 2019/06/30 18:49:50 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -177,6 +177,8 @@ curses+'perm_invent': don't highlight inventory letters since nothing is selectable from the menu comprising the persistent inventory window curses+'popup_dialog': show the text cursor at the end of prompts for single character input +curses+DUMPLOG: pass along old messages from save file and quest message + summaries to dumplog message history curses+EDIT_GETLIN: when a prompt's answer was preloaded, using ESC to discard it deleted it from the answer buffer but didn't erase it from screen curses+EDIT_GETLIN: the preceding fix handled an answer which spanned more diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index ba387f344..7c83ac423 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -887,6 +887,9 @@ boolean restoring_msghist; static boolean initd = FALSE; static int stash_count; static nhprev_mesg *stash_head = 0; +#ifdef DUMPLOG + extern unsigned saved_pline_index; /* pline.c */ +#endif if (restoring_msghist && !initd) { /* hide any messages we've gathered since starting current session @@ -896,12 +899,19 @@ boolean restoring_msghist; stash_head = first_mesg, first_mesg = (nhprev_mesg *) 0; last_mesg = (nhprev_mesg *) 0; /* no need to remember the tail */ initd = TRUE; +#ifdef DUMPLOG + /* this suffices; there's no need to scrub saved_pline[] pointers */ + saved_pline_index = 0; +#endif } if (msg) { mesg_add_line(msg); /* treat all saved and restored messages as turn #1 */ last_mesg->turn = 1L; +#ifdef DUMPLOG + dumplogmsg(last_mesg->str); +#endif } else if (stash_count) { nhprev_mesg *mesg; long mesg_turn; @@ -921,6 +931,9 @@ boolean restoring_msghist; mesg_add_line(mesg->str); /* added line became new tail */ last_mesg->turn = mesg_turn; +#ifdef DUMPLOG + dumplogmsg(mesg->str); +#endif free((genericptr_t) mesg->str); free((genericptr_t) mesg); } From 4db3b55057b5c2abae7617e1d1505dbda5f90360 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 30 Jun 2019 13:45:14 -0700 Subject: [PATCH 2/3] wishing vs EDIT_GETLIN If you ask for help when wishing, don't leave "help" in the buffer for EDIT_GETLIN to use as default answer on next retry. It does still leave anything rejected as unknown so that the player has a change to review the spelling and conceivably add and/or remove from the end witout having to retype everything. --- src/zap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/zap.c b/src/zap.c index 1563d434c..c8bbe34a9 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 zap.c $NHDT-Date: 1559994626 2019/06/08 11:50:26 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.311 $ */ +/* NetHack 3.6 zap.c $NHDT-Date: 1561927499 2019/06/30 20:44:59 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.312 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4115,7 +4115,7 @@ boolean say; /* Announce out of sight hit/miss events if true */ break; if (type >= 0) mon->mstrategy &= ~STRAT_WAITMASK; - buzzmonst: + buzzmonst: notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y); if (zap_hit(find_mac(mon), spell_type)) { if (mon_reflects(mon, (char *) 0)) { @@ -4235,7 +4235,7 @@ boolean say; /* Announce out of sight hit/miss events if true */ uchar rmn; boolean fireball; - make_bounce: + make_bounce: bchance = (levl[sx][sy].typ == STONE) ? 10 : (In_mines(&u.uz) && IS_WALL(levl[sx][sy].typ)) ? 20 : 75; @@ -4638,7 +4638,7 @@ short exploding_wand_typ; hear_txt = "crackling."; break; default: - def_case: + def_case: if (exploding_wand_typ > 0) { /* Magical explosion from misc exploding wand */ if (exploding_wand_typ == WAN_STRIKING) { @@ -5282,7 +5282,7 @@ makewish() nothing = zeroobj; /* lint suppression; only its address matters */ if (flags.verbose) You("may wish for an object."); -retry: + retry: Strcpy(promptbuf, "For what do you wish"); if (iflags.cmdassist && tries > 0) Strcat(promptbuf, " (enter 'help' for assistance)"); @@ -5293,6 +5293,7 @@ retry: buf[0] = '\0'; } else if (!strcmpi(buf, "help")) { wishcmdassist(MAXWISHTRY - tries); + buf[0] = '\0'; /* for EDIT_GETLIN */ goto retry; } /* From e35a216e51bc903d8948df3057525a8739e41469 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 30 Jun 2019 16:54:34 -0400 Subject: [PATCH 3/3] last NetHack-3.6 travis build passed so re-enable notifications to devteam --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 818b1bf5a..e2c522f80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,6 +108,6 @@ sudo: false notifications: email: recipients: -# - devteam@nethack.org + - devteam@nethack.org