From bf7a2596467ef5fe89c48812774fa959448ad18c Mon Sep 17 00:00:00 2001 From: Haoyang Wang Date: Wed, 9 Dec 2015 22:25:28 -0800 Subject: [PATCH 01/23] turn off use_darkgray in sysconf --- sys/unix/hints/macosx10.10 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index 683284cca..880b4989f 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -265,7 +265,12 @@ build_package_root: install -p doc/recover.6 $(PKGROOT_UG)/man/man6 install -p doc/Guidebook $(PKGROOT_UG)/doc install -p dat/nhdat $(PKGROOT_UGLN) - sed 's/^GDBPATH/#GDBPATH/' sys/unix/sysconf | sed 's/^GREPPATH=\/bin\/grep/GREPPATH=\/usr\/bin\/grep/' | sed 's/^PANICTRACE_GDB=[12]/PANICTRACE_GDB=0/' > $(PKGROOT_UGLN)/sysconf + setnl=`echo 'nl="'; echo '"'`; eval "$$setnl"; \ + sed 's/^GDBPATH/#GDBPATH/' sys/unix/sysconf \ + | sed 's/^GREPPATH=\/bin\/grep/GREPPATH=\/usr\/bin\/grep/' \ + | sed 's/^PANICTRACE_GDB=[12]/PANICTRACE_GDB=0/' \ + | sed "s/^#OPTIONS=.*/&\\$${nl}OPTIONS=!use_darkgray/" \ + > $(PKGROOT_UGLN)/sysconf cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN) # XXX these files should be somewhere else for good Mac form touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile From 894c751043e4c5a7a10f74fb330d3abe946d5bb8 Mon Sep 17 00:00:00 2001 From: Haoyang Wang Date: Thu, 10 Dec 2015 20:34:20 -0800 Subject: [PATCH 02/23] added editsysconf command in macosx.sh --- sys/unix/hints/macosx.sh | 9 +++++++++ sys/unix/hints/macosx10.10 | 7 +------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh index 753c9b685..c16e9095d 100755 --- a/sys/unix/hints/macosx.sh +++ b/sys/unix/hints/macosx.sh @@ -91,6 +91,15 @@ xgroup2) fi ;; +xeditsysconf) + sed 's/^GDBPATH/#GDBPATH/' $2 \ + | sed 's/^GREPPATH=\/bin\/grep/GREPPATH=\/usr\/bin\/grep/' \ + | sed 's/^PANICTRACE_GDB=[12]/PANICTRACE_GDB=0/' \ + | sed 's/^#OPTIONS=.*/&\ +OPTIONS=!use_darkgray/' \ + > $3 + ;; + #% dscl localhost -read /Search/Groups/wheel # AppleMetaNodeLocation: /Local/Default # GeneratedUID: ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000 diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index 880b4989f..6f9a48b06 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -265,12 +265,7 @@ build_package_root: install -p doc/recover.6 $(PKGROOT_UG)/man/man6 install -p doc/Guidebook $(PKGROOT_UG)/doc install -p dat/nhdat $(PKGROOT_UGLN) - setnl=`echo 'nl="'; echo '"'`; eval "$$setnl"; \ - sed 's/^GDBPATH/#GDBPATH/' sys/unix/sysconf \ - | sed 's/^GREPPATH=\/bin\/grep/GREPPATH=\/usr\/bin\/grep/' \ - | sed 's/^PANICTRACE_GDB=[12]/PANICTRACE_GDB=0/' \ - | sed "s/^#OPTIONS=.*/&\\$${nl}OPTIONS=!use_darkgray/" \ - > $(PKGROOT_UGLN)/sysconf + sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN) # XXX these files should be somewhere else for good Mac form touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile From ad138be8fbd8194d957afb7b4c842a8b1c904146 Mon Sep 17 00:00:00 2001 From: Haoyang Wang Date: Sat, 12 Dec 2015 08:35:13 -0800 Subject: [PATCH 03/23] use 'macosx.sh editsysconf' to install sysconf --- sys/unix/hints/macosx.sh | 14 +++++++++----- sys/unix/hints/macosx10.10 | 4 ++-- sys/unix/hints/macosx10.5 | 4 ++-- sys/unix/hints/macosx10.7 | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh index c16e9095d..ffc4db9cd 100755 --- a/sys/unix/hints/macosx.sh +++ b/sys/unix/hints/macosx.sh @@ -92,12 +92,16 @@ xgroup2) ;; xeditsysconf) - sed 's/^GDBPATH/#GDBPATH/' $2 \ - | sed 's/^GREPPATH=\/bin\/grep/GREPPATH=\/usr\/bin\/grep/' \ - | sed 's/^PANICTRACE_GDB=[12]/PANICTRACE_GDB=0/' \ - | sed 's/^#OPTIONS=.*/&\ + src=$2 + dest=$3 + if ! [ -e $dest ]; then + sed 's/^GDBPATH/#GDBPATH/' $src \ + | sed 's/^GREPPATH=\/bin\/grep/GREPPATH=\/usr\/bin\/grep/' \ + | sed 's/^PANICTRACE_GDB=[12]/PANICTRACE_GDB=0/' \ + | sed 's/^#OPTIONS=.*/&\ OPTIONS=!use_darkgray/' \ - > $3 + > $dest + fi ;; #% dscl localhost -read /Search/Groups/wheel diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index 6f9a48b06..e46f0e590 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -154,7 +154,7 @@ ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1) # XXX it's nice we don't write over sysconf, but we've already erased it # make sure we have group GAMEUID and group GAMEGRP PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR) -POSTINSTALL+= cp -n sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; +POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE else ifdef WANT_SOURCE_INSTALL PREFIX=$(abspath $(NHSROOT)) @@ -182,7 +182,7 @@ ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc endif # WANT_WIN_X11 -POSTINSTALL+= cp -n sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; +POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE endif # !WANT_SOURCE_INSTALL diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index 0ee5d7bdb..d87649671 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -141,7 +141,7 @@ ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1) # XXX it's nice we don't write over sysconf, but we've already erased it # make sure we have group GAMEUID and group GAMEGRP PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR) -POSTINSTALL+= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; +POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE else ifdef WANT_SOURCE_INSTALL PREFIX=$(abspath $(NHSROOT)) @@ -172,7 +172,7 @@ ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc endif # WANT_WIN_X11 -POSTINSTALL+= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; +POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE endif # !WANT_SOURCE_INSTALL diff --git a/sys/unix/hints/macosx10.7 b/sys/unix/hints/macosx10.7 index f314c9a3c..707c67da2 100644 --- a/sys/unix/hints/macosx10.7 +++ b/sys/unix/hints/macosx10.7 @@ -158,7 +158,7 @@ ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1) # XXX it's nice we don't write over sysconf, but we've already erased it # make sure we have group GAMEUID and group GAMEGRP PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR) -POSTINSTALL+= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; +POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE else ifdef WANT_SOURCE_INSTALL PREFIX=$(abspath $(NHSROOT)) @@ -190,7 +190,7 @@ ifdef WANT_WIN_X11 # install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc endif # WANT_WIN_X11 -POSTINSTALL+= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; +POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf; CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE endif # !WANT_SOURCE_INSTALL From 8f2a408ef350b20bcc8f3120dbf235e8eb5cae45 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 17 Dec 2015 06:37:08 -0800 Subject: [PATCH 04/23] fix #H4065 - unnecessary role select confirmation If player specified all four facets of role: role, race, gender, and alignment, via command line or option settings, the tty interface still asked the player to confirm whether the character's role/&c was ok? Skip that confirmation when all four things have already been chosen. --- doc/fixes36.1 | 2 ++ win/tty/wintty.c | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index f27e377eb..80dabedc8 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -42,6 +42,8 @@ Platform- and/or Interface-Specific Fixes ----------------------------------------- tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the line below it, leaving bogus '.' displayed on the top row of the map +tty: specifying all four of role, race, gender, and alignment still prompted + for confirmation with "Is this ok?" before starting play unix/X11: in top level Makefile, some commented out definitions of VARDATND misspelled pilemark.xbm (as pilemark.xpm) win32gui: getversionstring() was overflowing the provided Help About buffer diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 2eace09e5..96cc9b1ee 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1450320157 2015/12/17 02:42:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.117 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1450363024 2015/12/17 14:37:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.118 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -331,14 +331,25 @@ void tty_player_selection() { int i, k, n, choice, nextpick; - boolean getconfirmation; + boolean getconfirmation, picksomething; char pick4u = 'n'; char pbuf[QBUFSZ], plbuf[QBUFSZ]; winid win; anything any; menu_item *selected = 0; - if (flags.randomall) { + /* Used to avoid "Is this ok?" if player has already specified all + * four facets of role. + * Note that rigid_role_checks might force any unspecified facets to + * have a specific value, but that will still require confirmation; + * player can specify the forced ones if avoiding that is demanded. + */ + picksomething = (ROLE == ROLE_NONE || RACE == ROLE_NONE + || GEND == ROLE_NONE || ALGN == ROLE_NONE); + /* Used for '-@'; + * choose randomly without asking for all unspecified facets. + */ + if (flags.randomall && picksomething) { if (ROLE == ROLE_NONE) ROLE = ROLE_RANDOM; if (RACE == ROLE_NONE) @@ -349,7 +360,8 @@ tty_player_selection() ALGN = ROLE_RANDOM; } - /* prevent an unnecessary prompt */ + /* prevent unnecessary prompting if role forces race (samurai) or gender + (valkyrie) or alignment (rogue), or race forces alignment (orc), &c */ rigid_role_checks(); /* Should we randomly pick for the player? */ @@ -742,7 +754,7 @@ makepicks: * q - quit * (end) */ - getconfirmation = (pick4u != 'a' && !flags.randomall); + getconfirmation = (picksomething && pick4u != 'a' && !flags.randomall); while (getconfirmation) { tty_clear_nhwindow(BASE_WINDOW); role_selection_prolog(ROLE_NONE, BASE_WINDOW); From 69cfa4b134e5afaeddb4694589827ece49d5fcbd Mon Sep 17 00:00:00 2001 From: Haoyang Wang Date: Thu, 17 Dec 2015 06:53:14 -0800 Subject: [PATCH 05/23] set permissions of symbols file in package postinstall script --- sys/unix/hints/macosx10.10 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index e46f0e590..3f0387c17 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -282,7 +282,9 @@ build_package_root: echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall + echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall + echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall From 85d7d2bc43d088e4018a1d91e5de099b4e7496f0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 17 Dec 2015 21:12:59 +0200 Subject: [PATCH 06/23] Remove symbol setting options which do not work anymore --- dat/opthelp | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/dat/opthelp b/dat/opthelp index aae263a39..c378e618c 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -163,38 +163,6 @@ align Your starting alignment (align:lawful, align:neutral, or align:chaotic). You may specify just the first letter. [RANDOM] catname the name of your first cat [NONE] dogname the name of your first dog [NONE] -dungeon a list of symbols to be used in place of the default ones for - drawing the dungeon. - The symbols are subjected to a fair amount of processing, so - that you can use C-style escapes such as \n or \081 as well as - indicate control characters by ^x or meta characters by \Mx. - As usual, \ can force the next character to be taken literally. - Since many of the default symbols are overloaded, they are - given here by name instead of symbol, with some added notes: - stone (solid rock, normally ' ') - vwall hwall tlcorn trcorn blcorn brcorn (room boundaries) - crwall tuwall tdwall tlwall trwall (wallified maze characters) - nodoor vodoor hodoor (no, vertical, horizontal open door) - vcdoor hcdoor (vertical, horizontal closed door) - ironbars tree room darkcorr litcorr - upstair dnstair upladder dnladder - altar grave throne sink fountain pool ice lava - vodbridge hodbridge (vertical, horizontal open drawbridge) - vcdbridge hcdbridge (vertical, horizontal closed drawbridge) - air cloud water - default: \ |--------||.-|++##.##<><>_\\#{}.}..##\ #} -effects like dungeon, but for special effects symbols - vbeam hbeam lslant rslant (generic zap beams) - digbeam flashbeam (special beams for digging and cameras) - boomleft boomright (boomerangs) - ss1 ss2 ss3 ss4 (shielding sequence) - sw_topl, sw_topm, sw_topr, (swallow, top row) - sw_midl, sw_midr, (swallow, middle row [no center]) - sw_botl, sw_botm, sw_botr (swallow, bottom row) - extl extm extr (explosion matrix top row) - exml exmm exmr (explosion matrix middle row) - exbl exbm exbr (explosion matrix bottom row) - default: |-\\/*!)(0#@*/-\\||\\-//-\\|\ |\\-/ gender Your starting gender (gender:male or gender:female). You may specify just the first letter. Although you can still denote your gender using the "male" and "female" @@ -215,14 +183,9 @@ menu_* create single character accelerators for menu commands. Below menu_search search for a menu item [:](gxta) menu_select_all select all items in a menu [.](gxta) menu_select_page select all items on this menu page [,](gta) -monsters like dungeon, but for monster symbols - default: abcdefghijklmnopqrstuvwxyz - ABCDEFGHIJKLMNOPQRSTUVWXYZ@\ \\&;:~] msghistory number of top line messages to save [20] name the name of your character [obtained by asking the system or the player] -objects like dungeon, but for object symbols - default: ])[="(%!?+/$*`0_. pettype your preferred type of pet (cat or dog), if your character class uses both types; or none for no pet [RANDOM] playmode normal play or non-scoring explore mode or debug mode [normal] @@ -234,13 +197,6 @@ role Your starting role (e.g., role:Barbarian, role:Valk). as possible. You can also still denote your role by appending it to the "name" option (e.g., name:Vic-V), but the "role" option will take precedence. [RANDOM] -traps like dungeon, but for trap symbols - arrow_trap dart_trap falling_rock_trap squeaky_board - bear_trap land_mine rolling_boulder_trap sleeping_gas_trap - rust_trap fire_trap pit spiked_pit hole trap_door - teleportation_trap level_teleporter magic_portal web statue_trap - magic_trap anti_magic_trap polymorph_trap - default: ^^^^^^^^^^^^^^^^^"^^^^ windowtype windowing system to be used [depends on operating system] @@ -254,5 +210,4 @@ msg_window the type of message window to use: Some sample options lists are: !autopickup,!tombstone,name:Gandalf,scores:own/3 top/2 around -female,nonews,dogname:Rover,dungeon: |--------||.-|++.##<><>_\\#{}.}..## #} -rest_on_space,!verbose,menustyle:traditional +female,nonews,dogname:Rover,rest_on_space,!verbose,menustyle:traditional From 3e597b688234b7dd4f26ac2a718f3f2d33ef97fc Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 17 Dec 2015 20:27:42 -0500 Subject: [PATCH 07/23] Fix bug C343-20 wrong level shown at death Changes to be committed: modified: doc/fixes36.1 modified: src/ball.c I looked up the original bug report that led to bug page C343-20 "When dying immediately on entering a level, the map may show you dying on the previous level." It was received public report U891: > When one is being punished and goes down a staircase and dies because the > ball and chain fell on their head, one gets the message about their death > while the old level is still being displayed. I wasn't sure whether this > was a bug or not because on one hand it wouldn't make much sense to > generate a new level if the character is going to die anyway. However, > that being said it does make a difference if the character is about to go > down into a level where one cannot leave bones files, ie medusa or the > first level of the mines (if i remember correctly). So, if your character > dies from this does the bones file get left on the level you were on > (which is still displayed at the time of death) or the level you died as > soon as you got to (but was never displayed)? Thanks! Pat had remarked in response: "So this is just a display issue; game play works as intended (for the program; I imagine you weren't planning to get killed." A debug trace in wizard mode 3.6.1 beta shows that the relevant code path is this: NetHack.exe!done(int how) Line 908 NetHack.exe!losehp(int n, const char * knam, char k_format) Line 2678 NetHack.exe!drag_down(...) Line 823 NetHack.exe!goto_level(d_level * newlevel, char at_stairs, char falling, char portal) Line 1316 NetHack.exe!next_level(char at_stairs) Line 1157 NetHack.exe!dodown(...) Line 954 NetHack.exe!rhack(char * cmd) Line 3416 NetHack.exe!moveloop(char resuming) Line 464 NetHack.exe!main(int argc, char * * argv) Line 104 This patch clears the display for the situation in drag_down(), so the old level is not shown. --- doc/fixes36.1 | 2 ++ src/ball.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 80dabedc8..f68b47fee 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -36,6 +36,8 @@ make a previously-discovered scroll written with marker while blind have its label known so it can be read while blind #name or C for discoveries list that spanned multiple pages would exit on space instead of advancing to next page (workaround: use '>' instead) +don't show the old level when you die going down the stairs because of an + iron ball Platform- and/or Interface-Specific Fixes diff --git a/src/ball.c b/src/ball.c index 1a35eea1c..a4f148395 100644 --- a/src/ball.c +++ b/src/ball.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 ball.c $NHDT-Date: 1446808438 2015/11/06 11:13:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */ +/* NetHack 3.6 ball.c $NHDT-Date: 1450402033 2015/12/18 01:27:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.29 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -809,6 +809,9 @@ drag_down() if (carried(uball)) You("lose your grip on the iron ball."); + cls(); /* previous level is still displayed although you + went down the stairs. Avoids bug C343-20 */ + if (forward) { if (rn2(6)) { pline_The("iron ball drags you downstairs!"); From 20b2120f3f1b9888baad327f53a05b73d131d471 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 17 Dec 2015 19:50:06 -0800 Subject: [PATCH 08/23] fix bz 103+#H4095 - high scores ", while helpless" If a character dies with 'multi' at a non-zero value, the reason for helplessness is appended to the cause of death. But that was taking place in writeentry(), which is used for every score entry while rewriting 'record' when a new high score is added. So whenever a new score with helplessness was added, all existing entries got corrupted by having the newest game's reason for helplessness tacked on. Append the helplessness reason while formatting the cause of death instead of when writing out score and logfile entries. xlogfile is handled a little differently in case the cause of death plus reason for helplessness is too long so truncated for record and logfile. Full reason is still put into xlogfile. --- doc/fixes36.1 | 4 +++- src/rip.c | 7 +++++-- src/topten.c | 46 ++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index f68b47fee..bedec8986 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -36,8 +36,10 @@ make a previously-discovered scroll written with marker while blind have its label known so it can be read while blind #name or C for discoveries list that spanned multiple pages would exit on space instead of advancing to next page (workaround: use '>' instead) -don't show the old level when you die going down the stairs because of an +don't show the old level when you die going down the stairs because of an iron ball +new high score with ", while helpless" attribute appended would erroneously + result in ", while helpless" being appended to all scores Platform- and/or Interface-Specific Fixes diff --git a/src/rip.c b/src/rip.c index 80791cb84..c20cce2e2 100644 --- a/src/rip.c +++ b/src/rip.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 rip.c $NHDT-Date: 1436753522 2015/07/13 02:12:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */ +/* NetHack 3.6 rip.c $NHDT-Date: 1450410547 2015/12/18 03:49:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.21 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -91,7 +91,7 @@ time_t when; { register char **dp; register char *dpx; - char buf[BUFSZ]; + char buf[BUFSZ], *p; long year; register int x; int line; @@ -113,6 +113,9 @@ time_t when; /* Put together death description */ formatkiller(buf, sizeof buf, how); + /* strip ", while helpless" to keep reason shorter */ + if ((p = strstr(buf, ", while")) != 0) + *p = '\0'; /* Put death type on stone */ for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) { diff --git a/src/topten.c b/src/topten.c index 375eb1d23..553332352 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 topten.c $NHDT-Date: 1450231176 2015/12/16 01:59:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.41 $ */ +/* NetHack 3.6 topten.c $NHDT-Date: 1450410548 2015/12/18 03:49:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -64,10 +64,13 @@ STATIC_DCL void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P)); STATIC_DCL void FDECL(discardexcess, (FILE *)); STATIC_DCL void FDECL(readentry, (FILE *, struct toptenentry *)); STATIC_DCL void FDECL(writeentry, (FILE *, struct toptenentry *)); +#ifdef XLOGFILE STATIC_DCL void FDECL(writexlentry, (FILE *, struct toptenentry *)); +STATIC_DCL char *FDECL(shortdeath, (char *, char *)); STATIC_DCL long NDECL(encodexlogflags); STATIC_DCL long NDECL(encodeconduct); STATIC_DCL long NDECL(encodeachieve); +#endif STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *)); STATIC_DCL int FDECL(classmon, (char *, BOOLEAN_P)); STATIC_DCL int FDECL(score_wanted, (BOOLEAN_P, int, struct toptenentry *, int, @@ -118,6 +121,17 @@ int how; /* we're writing into buf[0] (after possibly advancing buf) rather than appending, but strncat() appends a terminator and strncpy() doesn't */ (void) strncat(buf, kname, siz - 1); + + if (multi) { + siz -= strlen(buf); + buf = eos(buf); + /* X <= siz: 'sizeof "string"' includes 1 for '\0' terminator */ + if (multi_reason && strlen(multi_reason) + sizeof ", while " <= siz) + Sprintf(buf, ", while %s", multi_reason); + else if (sizeof ", while helpless" <= siz) + Strcpy(buf, ", while helpless"); + /* else extra death info won't fit, so leave it out */ + } } STATIC_OVL void @@ -269,10 +283,10 @@ struct toptenentry *tt; static const char fmt33[] = "%s %s %s %s "; /* role,race,gndr,algn */ #ifndef NO_SCAN_BRACK static const char fmt0[] = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d "; - static const char fmtX[] = "%s,%s%s%s\n"; + static const char fmtX[] = "%s,%s\n"; #else /* NO_SCAN_BRACK */ static const char fmt0[] = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d "; - static const char fmtX[] = "%s %s%s%s\n"; + static const char fmtX[] = "%s %s\n"; nsb_mung_line(tt->name); nsb_mung_line(tt->death); @@ -288,9 +302,7 @@ struct toptenentry *tt; (void) fprintf(rfile, fmt33, tt->plrole, tt->plrace, tt->plgend, tt->plalign); (void) fprintf(rfile, fmtX, onlyspace(tt->name) ? "_" : tt->name, - tt->death, - (multi ? ", while " : ""), - (multi ? (multi_reason ? multi_reason : "helpless") : "")); + tt->death); #ifdef NO_SCAN_BRACK nsb_unmung_line(tt->name); @@ -298,6 +310,8 @@ struct toptenentry *tt; #endif } +#ifdef XLOGFILE + /* as tab is never used in eg. plname or death, no need to mangle those. */ STATIC_OVL void writexlentry(rfile, tt) @@ -306,7 +320,7 @@ struct toptenentry *tt; { #define Fprintf (void) fprintf #define XLOG_SEP '\t' /* xlogfile field separator. */ - char buf[BUFSZ]; + char buf[BUFSZ], tmpbuf[DTHSZ + 1]; Sprintf(buf, "version=%d.%d.%d", tt->ver_major, tt->ver_minor, tt->patchlevel); @@ -323,7 +337,7 @@ struct toptenentry *tt; tt->plalign); Fprintf(rfile, "%s%cname=%s%cdeath=%s", buf, /* (already includes separator) */ - XLOG_SEP, plname, XLOG_SEP, tt->death); + XLOG_SEP, plname, XLOG_SEP, shortdeath(tmpbuf, tt->death)); if (multi) Fprintf(rfile, "%cwhile=%s", XLOG_SEP, multi_reason ? multi_reason : "helpless"); @@ -340,6 +354,20 @@ struct toptenentry *tt; #undef XLOG_SEP } +/* used to strip ", while helpless" so xlogfile can show that separately + in case formatkiller() ending up truncating ", while "+multi_reason */ +STATIC_OVL char * +shortdeath(outbuf, deathstring) +char *outbuf, *deathstring; +{ + char *p; + + Strcpy(outbuf, deathstring); + if ((p = strstr(outbuf, ", while")) != 0) + *p = '\0'; + return outbuf; +} + STATIC_OVL long encodexlogflags() { @@ -425,6 +453,8 @@ encodeachieve() return r; } +#endif /* XLOGFILE */ + STATIC_OVL void free_ttlist(tt) struct toptenentry *tt; From 4604777c168d4ef5415aec062b99d1f48cdfe9be Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 18 Dec 2015 01:59:36 -0800 Subject: [PATCH 09/23] suppression of while-helpless for tombstone Avoid the possibility of a user-supplied name interfering with killer reason truncation. A monster named ", while" that killed the hero would result in "killed by called " being displayed on the tombstone after stripping while-helpless reason to shorten the text. --- include/extern.h | 4 ++-- src/bones.c | 4 ++-- src/dungeon.c | 4 ++-- src/end.c | 4 ++-- src/rip.c | 9 +++------ src/topten.c | 10 ++++++---- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/extern.h b/include/extern.h index 3806f5be6..564d863fd 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1449051498 2015/12/02 10:18:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.520 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1450432755 2015/12/18 09:59:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.521 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2293,7 +2293,7 @@ E void NDECL(timer_sanity_check); /* ### topten.c ### */ -E void FDECL(formatkiller, (char *, unsigned, int)); +E void FDECL(formatkiller, (char *, unsigned, int, BOOLEAN_P)); E void FDECL(topten, (int, time_t)); E void FDECL(prscore, (int, char **)); E struct obj *FDECL(tt_oname, (struct obj *)); diff --git a/src/bones.c b/src/bones.c index 423d3e3d0..6784259c6 100644 --- a/src/bones.c +++ b/src/bones.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 bones.c $NHDT-Date: 1450261363 2015/12/16 10:22:43 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.67 $ */ +/* NetHack 3.6 bones.c $NHDT-Date: 1450432756 2015/12/18 09:59:16 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.68 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */ /* NetHack may be freely redistributed. See license for details. */ @@ -479,7 +479,7 @@ make_bones: Sprintf(newbones->who, "%s-%.3s-%.3s-%.3s-%.3s", plname, urole.filecode, urace.filecode, genders[flags.female].filecode, aligns[1 - u.ualign.type].filecode); - formatkiller(newbones->how, sizeof newbones->how, how); + formatkiller(newbones->how, sizeof newbones->how, how, TRUE); Strcpy(newbones->when, yyyymmddhhmmss(when)); /* final resting place, used to decide when bones are discovered */ newbones->frpx = u.ux, newbones->frpy = u.uy; diff --git a/src/dungeon.c b/src/dungeon.c index 96b99591d..d101651a0 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dungeon.c $NHDT-Date: 1448862377 2015/11/30 05:46:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.69 $ */ +/* NetHack 3.6 dungeon.c $NHDT-Date: 1450432757 2015/12/18 09:59:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2895,7 +2895,7 @@ boolean printdun; if (died_here) { /* disclosure occurs before bones creation, so listing dead hero here doesn't give away whether bones are produced */ - formatkiller(tmpbuf, sizeof tmpbuf, how); + formatkiller(tmpbuf, sizeof tmpbuf, how, TRUE); /* rephrase a few death reasons to work with "you" */ (void) strsubst(tmpbuf, " himself", " yourself"); (void) strsubst(tmpbuf, " herself", " yourself"); diff --git a/src/end.c b/src/end.c index 20ca00d09..5e5231856 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 end.c $NHDT-Date: 1450231174 2015/12/16 01:59:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.110 $ */ +/* NetHack 3.6 end.c $NHDT-Date: 1450432758 2015/12/18 09:59:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.111 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1039,7 +1039,7 @@ int how; } corpse = mk_named_object(CORPSE, &mons[mnum], u.ux, u.uy, plname); Sprintf(pbuf, "%s, ", plname); - formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how); + formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how, TRUE); make_grave(u.ux, u.uy, pbuf); } pbuf[0] = '\0'; /* clear grave text; also lint suppression */ diff --git a/src/rip.c b/src/rip.c index c20cce2e2..64bd8dd01 100644 --- a/src/rip.c +++ b/src/rip.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 rip.c $NHDT-Date: 1450410547 2015/12/18 03:49:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.21 $ */ +/* NetHack 3.6 rip.c $NHDT-Date: 1450432760 2015/12/18 09:59:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -91,7 +91,7 @@ time_t when; { register char **dp; register char *dpx; - char buf[BUFSZ], *p; + char buf[BUFSZ]; long year; register int x; int line; @@ -112,10 +112,7 @@ time_t when; center(GOLD_LINE, buf); /* Put together death description */ - formatkiller(buf, sizeof buf, how); - /* strip ", while helpless" to keep reason shorter */ - if ((p = strstr(buf, ", while")) != 0) - *p = '\0'; + formatkiller(buf, sizeof buf, how, FALSE); /* Put death type on stone */ for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) { diff --git a/src/topten.c b/src/topten.c index 553332352..22ebaae1f 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 topten.c $NHDT-Date: 1450410548 2015/12/18 03:49:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.42 $ */ +/* NetHack 3.6 topten.c $NHDT-Date: 1450432761 2015/12/18 09:59:21 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.43 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -84,10 +84,11 @@ static winid toptenwin = WIN_ERR; /* "killed by",&c ["an"] 'killer.name' */ void -formatkiller(buf, siz, how) +formatkiller(buf, siz, how, incl_helpless) char *buf; unsigned siz; int how; +boolean incl_helpless; { static NEARDATA const char *const killed_by_prefix[] = { /* DIED, CHOKING, POISONING, STARVING, */ @@ -122,12 +123,13 @@ int how; appending, but strncat() appends a terminator and strncpy() doesn't */ (void) strncat(buf, kname, siz - 1); - if (multi) { + if (incl_helpless && multi) { siz -= strlen(buf); buf = eos(buf); /* X <= siz: 'sizeof "string"' includes 1 for '\0' terminator */ if (multi_reason && strlen(multi_reason) + sizeof ", while " <= siz) Sprintf(buf, ", while %s", multi_reason); + /* either multi_reason wasn't specified or wouldn't fit */ else if (sizeof ", while helpless" <= siz) Strcpy(buf, ", while helpless"); /* else extra death info won't fit, so leave it out */ @@ -542,7 +544,7 @@ time_t when; copynchars(t0->plgend, genders[flags.female].filecode, ROLESZ); copynchars(t0->plalign, aligns[1 - u.ualign.type].filecode, ROLESZ); copynchars(t0->name, plname, NAMSZ); - formatkiller(t0->death, sizeof t0->death, how); + formatkiller(t0->death, sizeof t0->death, how, TRUE); t0->birthdate = yyyymmdd(ubirthday); t0->deathdate = yyyymmdd(when); t0->tt_next = 0; From 6c767386976b558756d8b463f92c2340e8909585 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 18 Dec 2015 13:28:23 +0200 Subject: [PATCH 10/23] Fix typo in random epitaph --- dat/epitaph.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dat/epitaph.txt b/dat/epitaph.txt index 39d9f9b6c..a22b73c21 100644 --- a/dat/epitaph.txt +++ b/dat/epitaph.txt @@ -108,7 +108,7 @@ Algernon All else failed... All hail RNG All right, we'll call it a draw! -All's well that end well +All's well that ends well Alone at last! Always attack a floating eye from behind! Am I having fun yet? From 164b64b2632c5539c7e1aa0f548bf531e0cbd582 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 18 Dec 2015 16:12:53 +0200 Subject: [PATCH 11/23] Allow color name aliases for menucolors --- src/options.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/options.c b/src/options.c index d978ad033..37675c3d9 100644 --- a/src/options.c +++ b/src/options.c @@ -1221,14 +1221,20 @@ static const struct { { "magenta", CLR_MAGENTA }, { "cyan", CLR_CYAN }, { "gray", CLR_GRAY }, - { "grey", CLR_GRAY }, { "orange", CLR_ORANGE }, { "light green", CLR_BRIGHT_GREEN }, { "yellow", CLR_YELLOW }, { "light blue", CLR_BRIGHT_BLUE }, { "light magenta", CLR_BRIGHT_MAGENTA }, { "light cyan", CLR_BRIGHT_CYAN }, - { "white", CLR_WHITE } + { "white", CLR_WHITE }, + { NULL, CLR_BLACK }, /* everything after this is an alias */ + { "grey", CLR_GRAY }, + { "bright red", CLR_ORANGE }, + { "bright green", CLR_BRIGHT_GREEN }, + { "bright blue", CLR_BRIGHT_BLUE }, + { "bright magenta", CLR_BRIGHT_MAGENTA }, + { "bright cyan", CLR_BRIGHT_CYAN } }; static const struct { @@ -1250,7 +1256,7 @@ int clr; int i; for (i = 0; i < SIZE(colornames); i++) - if (colornames[i].color == clr) + if (colornames[i].name && colornames[i].color == clr) return colornames[i].name; return (char *) 0; } @@ -1279,8 +1285,8 @@ query_color() start_menu(tmpwin); any = zeroany; for (i = 0; i < SIZE(colornames); i++) { - if (!strcmp(colornames[i].name, "grey")) - continue; + if (!colornames[i].name) + break; any.a_int = i + 1; add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, colornames[i].name, MENU_UNSELECTED); @@ -1547,7 +1553,8 @@ char *str; (also junk like "_l i-gh_t---b l u e" but we won't worry about that); also copes with trailing space; mungspaces removed any leading space */ for (i = 0; i < SIZE(colornames); i++) - if (fuzzymatch(tmps, colornames[i].name, " -_", TRUE)) { + if (colornames[i].name + && fuzzymatch(tmps, colornames[i].name, " -_", TRUE)) { c = colornames[i].color; break; } From fcc30bee8846f64223debc96194114102896a64a Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 18 Dec 2015 07:11:41 -0800 Subject: [PATCH 12/23] more while-helpless Guard xlogfile entries against naming killer monst ", while". --- src/topten.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/topten.c b/src/topten.c index 22ebaae1f..9af1d54df 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 topten.c $NHDT-Date: 1450432761 2015/12/18 09:59:21 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.43 $ */ +/* NetHack 3.6 topten.c $NHDT-Date: 1450451497 2015/12/18 15:11:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -65,8 +65,7 @@ STATIC_DCL void FDECL(discardexcess, (FILE *)); STATIC_DCL void FDECL(readentry, (FILE *, struct toptenentry *)); STATIC_DCL void FDECL(writeentry, (FILE *, struct toptenentry *)); #ifdef XLOGFILE -STATIC_DCL void FDECL(writexlentry, (FILE *, struct toptenentry *)); -STATIC_DCL char *FDECL(shortdeath, (char *, char *)); +STATIC_DCL void FDECL(writexlentry, (FILE *, struct toptenentry *, int)); STATIC_DCL long NDECL(encodexlogflags); STATIC_DCL long NDECL(encodeconduct); STATIC_DCL long NDECL(encodeachieve); @@ -316,9 +315,10 @@ struct toptenentry *tt; /* as tab is never used in eg. plname or death, no need to mangle those. */ STATIC_OVL void -writexlentry(rfile, tt) +writexlentry(rfile, tt, how) FILE *rfile; struct toptenentry *tt; +int how; { #define Fprintf (void) fprintf #define XLOG_SEP '\t' /* xlogfile field separator. */ @@ -337,9 +337,11 @@ struct toptenentry *tt; Sprintf(buf, "%crole=%s%crace=%s%cgender=%s%calign=%s", XLOG_SEP, tt->plrole, XLOG_SEP, tt->plrace, XLOG_SEP, tt->plgend, XLOG_SEP, tt->plalign); + /* make a copy of death reason that doesn't include ", while helpless" */ + formatkiller(tmpbuf, sizeof tmpbuf, how, FALSE); Fprintf(rfile, "%s%cname=%s%cdeath=%s", buf, /* (already includes separator) */ - XLOG_SEP, plname, XLOG_SEP, shortdeath(tmpbuf, tt->death)); + XLOG_SEP, plname, XLOG_SEP, tmpbuf); if (multi) Fprintf(rfile, "%cwhile=%s", XLOG_SEP, multi_reason ? multi_reason : "helpless"); @@ -356,20 +358,6 @@ struct toptenentry *tt; #undef XLOG_SEP } -/* used to strip ", while helpless" so xlogfile can show that separately - in case formatkiller() ending up truncating ", while "+multi_reason */ -STATIC_OVL char * -shortdeath(outbuf, deathstring) -char *outbuf, *deathstring; -{ - char *p; - - Strcpy(outbuf, deathstring); - if ((p = strstr(outbuf, ", while")) != 0) - *p = '\0'; - return outbuf; -} - STATIC_OVL long encodexlogflags() { @@ -568,7 +556,7 @@ time_t when; if (!(xlfile = fopen_datafile(XLOGFILE, "a", SCOREPREFIX))) { HUP raw_print("Cannot open extended log file!"); } else { - writexlentry(xlfile, t0); + writexlentry(xlfile, t0, how); (void) fclose(xlfile); } unlock_file(XLOGFILE); @@ -579,6 +567,7 @@ time_t when; if (how != PANICKED) HUP { char pbuf[BUFSZ]; + topten_print(""); Sprintf(pbuf, "Since you were in %s mode, the score list will not be checked.", From c097814f3c662ff9fe16c56b05f5f5bbbadeb00e Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 18 Dec 2015 07:18:58 -0800 Subject: [PATCH 13/23] warning bit Suppress a couple of 'dead increment' diagnostics from the clang static analyzer. The assignments are dead, but keeping the variable up to date is more valuable (in case someone someday changes the code to use the affected variable somewhere farther along in that function) than changing the code to avoid the assignments in order to prevent the diagnostic. This will only work to suppress the analyzer's diagnostic messages if either FORCE_ARG_USAGE or GCC_WARN is defined when compiling makemon.c. --- src/makemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/makemon.c b/src/makemon.c index 102379e4a..55cf66fab 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 makemon.c $NHDT-Date: 1449269917 2015/12/04 22:58:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */ +/* NetHack 3.6 makemon.c $NHDT-Date: 1450451931 2015/12/18 15:18:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.106 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -599,6 +599,8 @@ register struct monst *mtmp; else if (mac < 10 && rn2(2)) mac += 1 + mongets(mtmp, LEATHER_CLOAK); + nhUse(mac); /* suppress 'dead increment' from static analyzer */ + if (ptr != &mons[PM_GUARD] && ptr != &mons[PM_WATCHMAN] && ptr != &mons[PM_WATCH_CAPTAIN]) { if (!rn2(3)) From c5e2604cca8d920860e23b051d6a11a3f6b6922d Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 18 Dec 2015 07:42:23 -0800 Subject: [PATCH 14/23] still more while-helpless --- sys/amiga/amirip.c | 6 +++--- win/X11/wintext.c | 4 ++-- win/gem/wingem.c | 4 ++-- win/gnome/gnbind.c | 4 ++-- win/win32/mswproc.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index 0c5e02f7a..e5a93ff94 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 amirip.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */ +/* NetHack 3.6 amirip.c $NHDT-Date: 1450453302 2015/12/18 15:41:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1991,1992,1993,1995,1996. */ /* NetHack may be freely redistributed. See license for details. */ @@ -161,7 +161,7 @@ time_t when; 0xc0, 0xff, NULL); /* Put together death description */ - formatkiller(buf, sizeof buf, how); + formatkiller(buf, sizeof buf, how, FALSE); tw = TextLength(rp, buf, STONE_LINE_LEN) + 40; @@ -196,7 +196,7 @@ time_t when; tomb_text(buf); /* Put together death description */ - formatkiller(buf, sizeof buf, how); + formatkiller(buf, sizeof buf, how, FALSE); /* Put death type on stone */ for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) { diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 433527dae..ada6a398d 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintext.c $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */ +/* NetHack 3.6 wintext.c $NHDT-Date: 1450453309 2015/12/18 15:41:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -498,7 +498,7 @@ calculate_rip_text(int how, time_t when) /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money); /* Put together death description */ - formatkiller(buf, sizeof buf, how); + formatkiller(buf, sizeof buf, how, FALSE); /* Put death type on stone */ for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) { diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 33b370275..1d059eed0 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wingem.c $NHDT-Date: 1433806613 2015/06/08 23:36:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */ +/* NetHack 3.6 wingem.c $NHDT-Date: 1450453304 2015/12/18 15:41:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.26 $ */ /* Copyright (c) Christian Bressler, 1999 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1083,7 +1083,7 @@ time_t when; /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money); /* Put together death description */ - formatkiller(buf, sizeof buf, how); + formatkiller(buf, sizeof buf, how, FALSE); /* Put death type on stone */ for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) { diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index cc40bb137..afeef0d1c 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 gnbind.c $NHDT-Date: 1433806614 2015/06/08 23:36:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.32 $ */ +/* NetHack 3.6 gnbind.c $NHDT-Date: 1450453305 2015/12/18 15:41:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.33 $ */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ @@ -1182,7 +1182,7 @@ gnome_outrip(winid wid, int how, time_t when) Strcat(ripString, buf); /* Put together death description */ - formatkiller(buf, sizeof buf, how); + formatkiller(buf, sizeof buf, how, FALSE); /* Put death type on stone */ Strcat(ripString, buf); diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 798385c65..a259e9fcc 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mswproc.c $NHDT-Date: 1450306253 2015/12/16 22:50:53 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */ +/* NetHack 3.6 mswproc.c $NHDT-Date: 1450453307 2015/12/18 15:41:47 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.97 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ @@ -1845,7 +1845,7 @@ mswin_outrip(winid wid, int how, time_t when) putstr(wid, 0, buf); /* Put together death description */ - formatkiller(buf, sizeof buf, how); + formatkiller(buf, sizeof buf, how, FALSE); /* Put death type on stone */ putstr(wid, 0, buf); From 24aea231d4e5991101b408b5777bf4f13ad14bd9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 18 Dec 2015 18:49:50 +0200 Subject: [PATCH 15/23] Add fixes entries --- doc/fixes36.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index bedec8986..22e70e2ec 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -40,6 +40,8 @@ don't show the old level when you die going down the stairs because of an iron ball new high score with ", while helpless" attribute appended would erroneously result in ", while helpless" being appended to all scores +allow bright aliases for colors in menucolors +make MAXPLAYERS option in sysconf accept 0 value Platform- and/or Interface-Specific Fixes From 7019a7da77593e77d165a427f9839fc50f832d90 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 12:50:25 -0500 Subject: [PATCH 16/23] fix H4101: can hear pets while deaf This is a fix for H4101, bz192. add non-audio (felt) outcome to yelp() This also add #wizintrinsic command because testing this was a pain without a simple, straightforward way to go deaf that didn't time-out before the situation being tested recurred. --- doc/fixes36.1 | 3 ++- src/cmd.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- src/sounds.c | 14 +++++++------- src/trap.c | 15 ++++++++++++--- 4 files changed, 67 insertions(+), 12 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index bedec8986..b307e0b74 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -40,6 +40,7 @@ don't show the old level when you die going down the stairs because of an iron ball new high score with ", while helpless" attribute appended would erroneously result in ", while helpless" being appended to all scores +avoid hearing yelps when you are deaf Platform- and/or Interface-Specific Fixes @@ -62,7 +63,7 @@ General New Features -------------------- naming Sting or Orcrist now breaks illiterate conduct different feedback for reading a scroll of mail created by writing with marker - +wizard mode #wizintrinsic Platform- and/or Interface-Specific New Features ------------------------------------------------ diff --git a/src/cmd.c b/src/cmd.c index 156cf82fa..7e992560f 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1450178549 2015/12/15 11:22:29 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.209 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1450460999 2015/12/18 17:49:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.210 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -122,6 +122,7 @@ STATIC_PTR int NDECL(dotravel); STATIC_PTR int NDECL(doterrain); STATIC_PTR int NDECL(wiz_wish); STATIC_PTR int NDECL(wiz_identify); +STATIC_PTR int NDECL(wiz_intrinsic); STATIC_PTR int NDECL(wiz_map); STATIC_PTR int NDECL(wiz_genesis); STATIC_PTR int NDECL(wiz_where); @@ -1102,6 +1103,48 @@ wiz_smell(VOID_ARGS) return 0; } +/* #wizinstrinsic command to set some intrinsics for testing */ +STATIC_PTR int +wiz_intrinsic(VOID_ARGS) +{ + if (wizard) { + winid win; + anything any; + int i, n, accelerator; + menu_item *pick_list = (menu_item *) 0; + + static const char *const intrinsics[] = { + "deafness", + }; + + win = create_nhwindow(NHW_MENU); + start_menu(win); + accelerator = 0; + + for (i = 0; i < SIZE(intrinsics); ++i) { + accelerator = intrinsics[i][0]; + any.a_int = i + 1; + add_menu(win, NO_GLYPH, &any, accelerator, 0, ATR_NONE, intrinsics[i], FALSE); + } + end_menu(win, "Which intrinsic?"); + n = select_menu(win, PICK_ONE, &pick_list); + destroy_nhwindow(win); + + if (n >= 1) { + i = pick_list[0].item.a_int-1; + free((genericptr_t) pick_list); + } + + if (!strcmp(intrinsics[i],"deafness")) { + You("go deaf."); + incr_itimeout(&HDeaf, 30); + } + } else + pline("Unavailable command '%s'.", + visctrl((int) cmd_from_func(wiz_intrinsic))); + return 0; +} + /* #wizrumorcheck command - verify each rumor access */ STATIC_PTR int wiz_rumor_check(VOID_ARGS) @@ -2771,6 +2814,7 @@ struct ext_func_tab extcmdlist[] = { { (char *) 0, (char *) 0, donull, TRUE }, /* vanquished */ { (char *) 0, (char *) 0, donull, TRUE }, /* vision */ { (char *) 0, (char *) 0, donull, TRUE }, /* wizsmell */ + { (char *) 0, (char *) 0, donull, TRUE }, /* wizintrinsic */ #ifdef DEBUG { (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_traveldisplay */ { (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_bury */ @@ -2800,6 +2844,7 @@ static const struct ext_func_tab debug_extcmdlist[] = { { "vanquished", "list vanquished monsters", dovanquished, TRUE }, { "vision", "show vision array", wiz_show_vision, TRUE }, { "wizsmell", "smell monster", wiz_smell, TRUE }, + { "wizintrinsic", "set intrinsic", wiz_intrinsic, TRUE }, #ifdef DEBUG { "wizdebug_traveldisplay", "wizard debug: toggle travel display", wiz_debug_cmd_traveldisplay, TRUE }, diff --git a/src/sounds.c b/src/sounds.c index 5f5595018..a57f30e88 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sounds.c $NHDT-Date: 1450306219 2015/12/16 22:50:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.75 $ */ +/* NetHack 3.6 sounds.c $NHDT-Date: 1450461007 2015/12/18 17:50:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.76 $ */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -387,23 +387,23 @@ register struct monst *mtmp; else switch (mtmp->data->msound) { case MS_MEW: - yelp_verb = "yowl"; + yelp_verb = (!Deaf) ? "yowl" : "arch"; break; case MS_BARK: case MS_GROWL: - yelp_verb = "yelp"; + yelp_verb = (!Deaf) ? "yelp" : "recoil"; break; case MS_ROAR: - yelp_verb = "snarl"; + yelp_verb = (!Deaf) ? "snarl" : "bluff"; break; case MS_SQEEK: - yelp_verb = "squeal"; + yelp_verb = (!Deaf) ? "squeal" : "quivers"; break; case MS_SQAWK: - yelp_verb = "screak"; + yelp_verb = (!Deaf) ? "screak" : "thrash"; break; case MS_WAIL: - yelp_verb = "wail"; + yelp_verb = (!Deaf) ? "wail" : "cringe"; break; } if (yelp_verb) { diff --git a/src/trap.c b/src/trap.c index 747f626e6..7770d4188 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.c $NHDT-Date: 1449977947 2015/12/13 03:39:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.250 $ */ +/* NetHack 3.6 trap.c $NHDT-Date: 1450461008 2015/12/18 17:50:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.251 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3048,6 +3048,7 @@ domagictrap() /* Most of the time, it creates some monsters. */ register int cnt = rnd(4); + /* blindness effects */ if (!resists_blnd(&youmonst)) { You("are momentarily blinded by a flash of light!"); make_blinded((long) rn1(5, 10), FALSE); @@ -3055,9 +3056,17 @@ domagictrap() Your1(vision_clears); } else if (!Blind) { You_see("a flash of light!"); - } else + } + + /* deafness effects */ + if (!Deaf) { You_hear("a deafening roar!"); - incr_itimeout(&HDeaf, rn1(20, 30)); + incr_itimeout(&HDeaf, rn1(20, 30)); + } else { + /* magic vibrations still hit you */ + You_feel("rankled."); + incr_itimeout(&HDeaf, rn1(5, 15)); + } while (cnt--) (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS); } else From 2eddec82873e736db2672478c92be7f7b650da6b Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 13:00:35 -0500 Subject: [PATCH 17/23] fix typo in last patch to yelp() --- src/sounds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index a57f30e88..eaf36487d 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sounds.c $NHDT-Date: 1450461007 2015/12/18 17:50:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.76 $ */ +/* NetHack 3.6 sounds.c $NHDT-Date: 1450461632 2015/12/18 18:00:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.77 $ */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -397,7 +397,7 @@ register struct monst *mtmp; yelp_verb = (!Deaf) ? "snarl" : "bluff"; break; case MS_SQEEK: - yelp_verb = (!Deaf) ? "squeal" : "quivers"; + yelp_verb = (!Deaf) ? "squeal" : "quiver"; break; case MS_SQAWK: yelp_verb = (!Deaf) ? "screak" : "thrash"; From ec166df636100209c7af9b18b5747d8066a7a0f9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 16:23:05 -0500 Subject: [PATCH 18/23] handle escape from new wizmode menu appropriately --- src/cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd.c b/src/cmd.c index 7e992560f..9ed18debd 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1450460999 2015/12/18 17:49:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.210 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1450473780 2015/12/18 21:23:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.211 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1133,6 +1133,8 @@ wiz_intrinsic(VOID_ARGS) if (n >= 1) { i = pick_list[0].item.a_int-1; free((genericptr_t) pick_list); + } else { + return 0; } if (!strcmp(intrinsics[i],"deafness")) { From 97974e99681776f62982e91551e77ff7a53ba196 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 18:24:13 -0500 Subject: [PATCH 19/23] make corpse visible if stethoscope told you about it Bug bz14, no web id. Steps to reproduce: - have a stethoscope handy. - place an amulet in a doorway and move one square outside the room's door. - create and lead an invisible stalker to be on top of amulet, with you just outside the room beside the door square. - zap the stalker asleep with a wand of sleep. - put on a blindfold. - quaff a potion of object detection. - amulet shows in the doorway. - save the game and keep the savefile for ease of returning to this point. Bug 1 observed (remember that you're blind due to blindfold): - zap a wand of death at the stalker that you know to be on top of the amulet, but that the game gives no indication of. - if the stalker left a corpse, and you apply a stethoscope to the doorway, the game tells you that "You determine that that unfortunate being is dead" yet no being or corpse is displayed, still just the amulet. Fix that by calling map_object(corpse, TRUE) in its_dead() under these circumstances. The circumstances in the original report were also reproduced, specifically: If a stethoscope finds an unseen monster on a square with an object-detected object while blind, after killing the monster, the object isn't remembered. That remains unfixed because the I (invis monster glyph) aleady overwrote the detected object glyph, so it is a much tougher situation. --- src/apply.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/apply.c b/src/apply.c index 22cef7f5a..96c77386c 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 apply.c $NHDT-Date: 1446808436 2015/11/06 11:13:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.210 $ */ +/* NetHack 3.6 apply.c $NHDT-Date: 1450481050 2015/12/18 23:24:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.214 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -237,6 +237,13 @@ int rx, ry, *resp; } else if (corpse) { boolean here = (rx == u.ux && ry == u.uy), one = (corpse->quan == 1L && !more_corpses), reviver = FALSE; + int visglyph, corpseglyph; + + visglyph = glyph_at(rx, ry); + corpseglyph = obj_to_glyph(corpse); + + if (Blind && (visglyph != corpseglyph)) + map_object(corpse, TRUE); if (Role_if(PM_HEALER)) { /* ok to reset `corpse' here; we're done with it */ From 5ee09d66d61f956f0ec6c12aaa98b74e1ded9fc6 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 19:02:19 -0500 Subject: [PATCH 20/23] blind pronunciation of scroll formula not a literacy violation bug bz25, no web id, devteam email received on 1/3/2006 6:15 AM: > Reading a scroll while blind shouldn't violate illiterate conduct --- doc/fixes36.1 | 3 +++ src/read.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 9b47321e5..595831640 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -43,6 +43,8 @@ new high score with ", while helpless" attribute appended would erroneously allow bright aliases for colors in menucolors make MAXPLAYERS option in sysconf accept 0 value avoid hearing yelps when you are deaf +make corpse visible if stethoscope told you about it being there +blind pronounciation of scroll formula will not violate literacy conduct Platform- and/or Interface-Specific Fixes @@ -67,6 +69,7 @@ naming Sting or Orcrist now breaks illiterate conduct different feedback for reading a scroll of mail created by writing with marker wizard mode #wizintrinsic + Platform- and/or Interface-Specific New Features ------------------------------------------------ diff --git a/src/read.c b/src/read.c index 948156dc7..a141c157b 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 read.c $NHDT-Date: 1450261365 2015/12/16 10:22:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.128 $ */ +/* NetHack 3.6 read.c $NHDT-Date: 1450483329 2015/12/19 00:02:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.129 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -171,6 +171,7 @@ doread() { register struct obj *scroll; boolean confused, nodisappear; + boolean pronounced_not_read = FALSE; known = FALSE; if (check_capacity((char *) 0)) @@ -299,6 +300,8 @@ doread() what = "mystic runes"; else if (!scroll->dknown) what = "formula on the scroll"; + else if (scroll->dknown) + pronounced_not_read = TRUE; if (what) { pline("Being blind, you cannot read the %s.", what); return 0; @@ -329,7 +332,7 @@ doread() /* Novel conduct is handled in read_tribute so exclude it too*/ if (scroll->otyp != SPE_BOOK_OF_THE_DEAD && scroll->otyp != SPE_BLANK_PAPER && scroll->otyp != SCR_BLANK_PAPER - && scroll->otyp != SPE_NOVEL) + && scroll->otyp != SPE_NOVEL && !pronounced_not_read) u.uconduct.literate++; if (scroll->oclass == SPBOOK_CLASS) { From d6710ad1cc2e203523abe70f35b82def8916bd14 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 19:41:54 -0500 Subject: [PATCH 21/23] sceptre of might database entry update --- dat/data.base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dat/data.base b/dat/data.base index 1e9cdb9f7..be64ab79e 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4425,7 +4425,7 @@ scalpel This mace was created aeons ago in some unknown cave, and has been passed down from generation to generation of cave dwellers. It is a very mighty mace indeed, and in - addition will protect anyone who carries it from magic + addition will protect anyone who wields it from magic missile attacks. When invoked, it causes conflict in the area around it. scimitar From c69e1164387634f52850f1df1792b84d59fcbc03 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 19:47:18 -0500 Subject: [PATCH 22/23] fixes update for database change sceptre of might dat/database change fixes entry --- doc/fixes36.1 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 595831640..fd3dc6f81 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -45,6 +45,7 @@ make MAXPLAYERS option in sysconf accept 0 value avoid hearing yelps when you are deaf make corpse visible if stethoscope told you about it being there blind pronounciation of scroll formula will not violate literacy conduct +sceptre of might database entry word change Platform- and/or Interface-Specific Fixes From a5c63af579c5b5ce8039de502a95651a77457a14 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 18 Dec 2015 20:55:24 -0500 Subject: [PATCH 23/23] objected to --- doc/fixes36.1 | 1 - src/read.c | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index fd3dc6f81..5dc93f056 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -44,7 +44,6 @@ allow bright aliases for colors in menucolors make MAXPLAYERS option in sysconf accept 0 value avoid hearing yelps when you are deaf make corpse visible if stethoscope told you about it being there -blind pronounciation of scroll formula will not violate literacy conduct sceptre of might database entry word change diff --git a/src/read.c b/src/read.c index a141c157b..1e177eaf5 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 read.c $NHDT-Date: 1450483329 2015/12/19 00:02:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.129 $ */ +/* NetHack 3.6 read.c $NHDT-Date: 1450490118 2015/12/19 01:55:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.130 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -171,7 +171,6 @@ doread() { register struct obj *scroll; boolean confused, nodisappear; - boolean pronounced_not_read = FALSE; known = FALSE; if (check_capacity((char *) 0)) @@ -300,8 +299,6 @@ doread() what = "mystic runes"; else if (!scroll->dknown) what = "formula on the scroll"; - else if (scroll->dknown) - pronounced_not_read = TRUE; if (what) { pline("Being blind, you cannot read the %s.", what); return 0; @@ -332,7 +329,7 @@ doread() /* Novel conduct is handled in read_tribute so exclude it too*/ if (scroll->otyp != SPE_BOOK_OF_THE_DEAD && scroll->otyp != SPE_BLANK_PAPER && scroll->otyp != SCR_BLANK_PAPER - && scroll->otyp != SPE_NOVEL && !pronounced_not_read) + && scroll->otyp != SPE_NOVEL) u.uconduct.literate++; if (scroll->oclass == SPBOOK_CLASS) {