From 4ee6b130330c0a04007f2dd29788d4f468035df0 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 21 Nov 2018 16:47:42 -0800 Subject: [PATCH 1/9] vmsbuild.com update A copyright header inserted last spring uses the wrong format for a DCL comment and triggers a couple of warnings about invalid commands. Some linker hackery added a long time ago draws complaints from the linker on IA64. This was noticed during the release cycle for 3.6.0 but then went unaddressed. --- sys/vms/vmsbuild.com | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/vms/vmsbuild.com b/sys/vms/vmsbuild.com index 6d45bb444..d505ccad9 100755 --- a/sys/vms/vmsbuild.com +++ b/sys/vms/vmsbuild.com @@ -1,8 +1,8 @@ $ ! vms/vmsbuild.com -- compile and link NetHack 3.6.* [pr] $ version_number = "3.6.2" -$ ! $NHDT-Date: 1542411224 2018/11/16 23:33:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.19 $ -# Copyright (c) 2018 by Robert Patrick Rankin -# NetHack may be freely redistributed. See license for details. +$ ! $NHDT-Date: 1542847646 2018/11/22 00:47:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ +$ ! Copyright (c) 2018 by Robert Patrick Rankin +$ ! NetHack may be freely redistributed. See license for details. $ ! $ ! usage: $ ! $ set default [.src] !or [-.-.src] if starting from [.sys.vms] @@ -178,8 +178,13 @@ $ nethacklib = "[-.src]nethack.olb" $ create nethack.opt ! nethack.opt nethack.olb/Include=(vmsmain)/Library +! lib$initialize is used to call a routine (before main()) in vmsunix.c that +! tries to check whether debugger support has been linked in, for PANICTRACE sys$library:starlet.olb/Include=(lib$initialize) -psect_attr=lib$initialize, Con,Usr,noPic,Rel,Gbl,noShr,noExe,Rd,noWrt,Long +! psect_attr=lib$initialize, Con,Usr,noPic,Rel,Gbl,noShr,noExe,Rd,noWrt,Long +! IA64 linker doesn't support Usr or Pic and complains that Long is too small +psect_attr=lib$initialize, Con,Rel,Gbl,noShr,noExe,Rd,noWrt +! increase memory available to RMS (the default iosegment is probably adequate) iosegment=128 $ if f$search("nethack.opt;-2").nes."" then purge/Keep=2/noLog nethack.opt $ milestone = "write sys$output f$fao("" !5%T "",0)," From 55ad316079c857b18456a8d238bd8252f15b845b Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 21 Nov 2018 18:32:04 -0800 Subject: [PATCH 2/9] more Schroedinger's Cat Prevent food detection--scroll or crystal ball--from noticing the cat corpse inside SchroedingersBox since its presence is tentative and resolving its status during detection is a huge can of worms (live cat placement on map from inside locked box, parallel resolution required for monster detection/warning/telepathy that would render the box fairly useless since it would probably end up getting resolved by ESP before hero gains access). Prevent cat corpse in the Box from being added to shop bill if unpaid Box is picked up. That prevents it from being listed as a bought item if the player buys the box (instead of being described as unknown contents; an older, more general bug which still hasn't been fixed). As far as I'm aware, off the revised handling of Schroedingers Cat is finished. --- src/detect.c | 15 ++++++++++----- src/shk.c | 11 +++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/detect.c b/src/detect.c index 57ee916ce..416c2611f 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 detect.c $NHDT-Date: 1522891623 2018/04/05 01:27:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */ +/* NetHack 3.6 detect.c $NHDT-Date: 1542853884 2018/11/22 02:31:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.87 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -165,8 +165,14 @@ char oclass; if (obj->oclass == oclass) return obj; - - if (Has_contents(obj)) { + /* + * Note: we exclude SchroedingersBox because the corpse it contains + * isn't necessarily a corpse yet. Resolving the status would lead + * to complications if it turns out to be a live cat. We know that + * that Box can't contain anything else because putting something in + * would resolve the cat/corpse situation and convert to ordinary box. + */ + if (Has_contents(obj) && !SchroedingersBox(obj)) { for (otmp = obj->cobj; otmp; otmp = otmp->nobj) if (otmp->oclass == oclass) return otmp; @@ -442,8 +448,7 @@ outgoldmap: return 0; } -/* returns 1 if nothing was detected */ -/* returns 0 if something was detected */ +/* returns 1 if nothing was detected, 0 if something was detected */ int food_detect(sobj) register struct obj *sobj; diff --git a/src/shk.c b/src/shk.c index 472b1f165..c2895a29f 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 shk.c $NHDT-Date: 1515144230 2018/01/05 09:23:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.136 $ */ +/* NetHack 3.6 shk.c $NHDT-Date: 1542853899 2018/11/22 02:31:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.142 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2400,6 +2400,8 @@ register struct monst *shkp; { register struct obj *otmp; + if (SchroedingersBox(obj)) + return; for (otmp = obj->cobj; otmp; otmp = otmp->nobj) { if (otmp->oclass == COIN_CLASS) continue; @@ -2597,15 +2599,16 @@ char *buf; static const char *const honored[] = { "good", "honored", "most gracious", "esteemed", "most renowned and sacred" }; + Strcat(buf, honored[rn2(SIZE(honored) - 1) + u.uevent.udemigod]); if (is_vampire(youmonst.data)) Strcat(buf, (flags.female) ? " dark lady" : " dark lord"); else if (is_elf(youmonst.data)) Strcat(buf, (flags.female) ? " hiril" : " hir"); else - Strcat(buf, !is_human(youmonst.data) ? " creature" : (flags.female) - ? " lady" - : " sir"); + Strcat(buf, !is_human(youmonst.data) ? " creature" + : (flags.female) ? " lady" + : " sir"); } void From ac9bdc8aa76929a2dc3c9b2559d7dea6a3a3a3a0 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 21 Nov 2018 19:16:23 -0800 Subject: [PATCH 3/9] fix #H7585 - can't untrap from edge of pit Attempting to untrap an adjacent location failed if you had escaped a pit, claiming that you couldn't reach. You can't reach the bottom of the pit if you're not in it, but you should be able to reach adjacent spots normally. --- doc/fixes36.2 | 2 ++ src/trap.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 3f6bc996f..2ad652f36 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -207,6 +207,8 @@ if a migrating monster was killed off because there was no room on the which should never leave one (demon, golem, blob, &c) end of game while carrying Schroedinger's Box would reveal cat-or-corpse for inventory disclosure or put that info into dumplog, but not both +attempting to untrap an adjacent trap while on the edge of--not in--a pit + failed due to not being able to reach the floor Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/trap.c b/src/trap.c index da7e01625..330fa73e2 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.c $NHDT-Date: 1542765365 2018/11/21 01:56:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.303 $ */ +/* NetHack 3.6 trap.c $NHDT-Date: 1542856572 2018/11/22 03:16:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.304 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4038,7 +4038,7 @@ boolean force_failure; } } /* untrappable traps are located on the ground. */ - if (!can_reach_floor(TRUE)) { + if (!can_reach_floor(under_u)) { if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); else From 02749b762123eb60e76b82122dfeabccedc4ddf5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 22 Nov 2018 20:24:56 +0200 Subject: [PATCH 4/9] Fix guard shoving monsters away coordinate logic The logic required both x and y coordinates of the guard location and the new location the guard wanted to move to be different. This is obviously wrong, as the guard may move horizontally or vertically. --- src/vault.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vault.c b/src/vault.c index 1947aa75b..7e47577e2 100644 --- a/src/vault.c +++ b/src/vault.c @@ -585,10 +585,10 @@ gd_mv_monaway(grd, nx,ny) register struct monst *grd; int nx,ny; { - if (MON_AT(nx, ny) && nx != grd->mx && ny != grd->my) { + if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) { if (!Deaf) verbalize("Out of my way, scum!"); - if (!rloc(m_at(nx, ny), FALSE) || m_at(nx, ny)) + if (!rloc(m_at(nx, ny), FALSE) || MON_AT(nx, ny)) m_into_limbo(m_at(nx, ny)); } } From 80d1aae8a505be0e0f31fec4c1f3b9ed05fee40f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 23 Nov 2018 15:15:04 +0200 Subject: [PATCH 5/9] ifdef, not if --- include/rm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rm.h b/include/rm.h index d24c4e567..b6cf36d54 100644 --- a/include/rm.h +++ b/include/rm.h @@ -630,7 +630,7 @@ extern dlevel_t level; /* structure describing the current level */ #define MON_BURIED_AT(x, y) \ (level.monsters[x][y] != (struct monst *) 0 \ && (level.monsters[x][y])->mburied) -#if EXTRA_SANITY_CHECKS +#ifdef EXTRA_SANITY_CHECKS #define place_worm_seg(m, x, y) do { \ if (level.monsters[x][y] && level.monsters[x][y] != m) impossible("place_worm_seg over mon"); \ level.monsters[x][y] = m; \ From 4c1a819511d1146ba2f872e1d0d7b93aeff8fe7f Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Wed, 14 Nov 2018 15:28:37 +0100 Subject: [PATCH 6/9] Building tty, X11, and QT5 builds on Travis --- .travis.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8a11d4a0a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: c + +script: "cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ && QT_SELECT=5 make MOC=moc install" + +matrix: + include: + - env: HINTS=linux + compiler: gcc + - env: HINTS=linux + compiler: clang + - env: HINTS=linux-x11 + compiler: gcc + - env: HINTS=linux-qt5 + compiler: gcc + addons: + apt: + packages: + - qtbase5-dev + - qtmultimedia5-dev + - qtbase5-dev-tools + +sudo: false + +notifications: + email: + recipients: + - bhaak@gmx.net From a7ebb35d5eec526d198f583f88c05499d90e0113 Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Fri, 23 Nov 2018 16:22:41 +0100 Subject: [PATCH 7/9] Adding a travis job for a minimal build --- .travis.yml | 25 +++++++++++++++++++++++++ sys/unix/hints/linux-minimal | 31 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 sys/unix/hints/linux-minimal diff --git a/.travis.yml b/.travis.yml index 8a11d4a0a..03bac7a1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,31 @@ matrix: - qtbase5-dev - qtmultimedia5-dev - qtbase5-dev-tools + - env: HINTS=linux-minimal + compiler: gcc + script: | + cd sys/unix/ && sh setup.sh hints/$HINTS && cd ../../ + sed -i '/^#define CLIPPING/d' include/config.h + sed -i '/^#define COMPRESS/d' include/config.h + #sed -i '/^#define DOAGAIN/d' include/config.h + sed -i '/^#define DUMPLOG/d' include/config.h + #sed -i '/^#define GDBPATH/d' include/config.h + #sed -i '/^#define GREPPATH/d' include/config.h + sed -i '/^#define INSURANCE/d' include/config.h + sed -i '/^#define LOGFILE/d' include/config.h + sed -i '/^#define NEWS/d' include/config.h + sed -i '/^#define PANICLOG/d' include/config.h + #sed -i '/^#define STATUS_HILITES/d' include/config.h + sed -i '/^#define SYSCF/d' include/config.h + sed -i '/^#define USER_SOUNDS/d' include/config.h + sed -i '/^#define XLOGFILE/d' include/config.h + + sed -i '/^#define MAIL/d' include/unixconf.h + sed -i '/^#define SHELL/d' include/unixconf.h + sed -i '/^#define SUSPEND/d' include/unixconf.h + sed -i 's/^#define TEXTCOLOR//' include/unixconf.h + make install + cat dat/options sudo: false diff --git a/sys/unix/hints/linux-minimal b/sys/unix/hints/linux-minimal new file mode 100644 index 000000000..6c2638ae3 --- /dev/null +++ b/sys/unix/hints/linux-minimal @@ -0,0 +1,31 @@ +# +# NetHack 3.6 linux $NHDT-Date: 1432512814 2018/11/23 16:00:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ +# Copyright (c) Patric Mueller +# NetHack may be freely redistributed. See license for details. +# +#-PRE +# Hints file for a minimal build +# This hints file provides the base for a minimal tty build for Linux + +PREFIX=$(wildcard ~)/nethack-minimal +HACKDIR=$(PREFIX)/games/lib/$(GAME)dir +SHELLDIR=$(PREFIX)/games +INSTDIR=$(HACKDIR) +VARDIR=$(HACKDIR) + +CFLAGS=-g -I../include + +LINK=$(CC) + +WINSRC = $(WINTTYSRC) +WINOBJ = $(WINTTYOBJ) +WINLIB = $(WINTTYLIB) + +WINTTYLIB=-lcurses + +CHOWN=true +CHGRP=true + +VARDIRPERM = 0755 +VARFILEPERM = 0600 +GAMEPERM = 0755 From 3517277467e5f1fe28879a0a2b6b1c5123e8de81 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 23 Nov 2018 19:20:59 +0200 Subject: [PATCH 8/9] Add some commented out flags to linux hints file --- include/config.h | 4 ++++ sys/unix/hints/linux | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/config.h b/include/config.h index 4f242679a..d59a82af5 100644 --- a/include/config.h +++ b/include/config.h @@ -522,6 +522,10 @@ typedef unsigned char uchar; but it isn't necessary for successful operation of the program */ #define FREE_ALL_MEMORY /* free all memory at exit */ +/* EXTRA_SANITY_CHECKS adds extra impossible calls, + * probably not useful for normal play */ +/* #define EXTRA_SANITY_CHECKS */ + /* EDIT_GETLIN makes the string input in TTY, Qt4, and X11 so some prompts will remember the previously input text (within the same session) */ diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index cb0317946..1d9c45509 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -28,6 +28,12 @@ CFLAGS+=-DHACKDIR=\"$(HACKDIR)\" CFLAGS+=-DDUMPLOG CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE CFLAGS+=-DCURSES_GRAPHICS +#CFLAGS+=-DEXTRA_SANITY_CHECKS +#CFLAGS+=-DEDIT_GETLIN +#CFLAGS+=-DSCORE_ON_BOTL +#CFLAGS+=-DMSGHANDLER +#CFLAGS+=-DTTY_TILES_ESCCODES +#CFLAGS+=-DDLB LINK=$(CC) # Only needed for GLIBC stack trace: @@ -37,6 +43,10 @@ WINSRC = $(WINTTYSRC) $(WINCURSESSRC) WINOBJ = $(WINTTYOBJ) $(WINCURSESOBJ) WINLIB = $(WINTTYLIB) $(WINCURSESLIB) +# if TTY_TILES_ESCCODES +#WINSRC += tile.c +#WINOBJ += tile.o + WINTTYLIB=-lcurses CHOWN=true From d60097b2868d1f7403ddaa10d48d3be59bc7c1bb Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Fri, 23 Nov 2018 18:56:25 +0100 Subject: [PATCH 9/9] Send travis notification mails to mailing list --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 03bac7a1c..7866ecd0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,4 +49,4 @@ sudo: false notifications: email: recipients: - - bhaak@gmx.net + - devteam@nethack.org