Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-11-24 16:11:58 -05:00
14 changed files with 200 additions and 95 deletions

52
.travis.yml Normal file
View File

@@ -0,0 +1,52 @@
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
- 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
notifications:
email:
recipients:
- devteam@nethack.org

View File

@@ -205,8 +205,21 @@ successfully paying for shop damage with shop credit would be followed by
if a migrating monster was killed off because there was no room on the
destination level, it would leave a corpse even if it was a type
which should never leave one (demon, golem, blob, &c)
monsters accompanying hero during level change (usually pets) who failed to
arrive and tried to re-migrate were being removed from the map after
already having been removed [impossible "no monster to remove" if
compiled with EXTRA_SANITY_CHECKS enabled] during migration handling
monsters accompanying hero during level change (usually pets) who failed to
arrive and tried to re-migrate (for hero's next visit to the level)
ended up being killed because the migration attempt happened right
away (same visit by hero, so level still full) and they weren't
accompanying hero on the second attempt
fix for above (all failed arrivals will re-migrate) makes the earlier fix (for
invalid corpse being left by monst killed upon migration failure) moot
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

View File

@@ -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) */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 rm.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.41 $ */
/* NetHack 3.6 rm.h $NHDT-Date: 1543052680 2018/11/24 09:44:40 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2017. */
/* NetHack may be freely redistributed. See license for details. */
@@ -633,14 +633,18 @@ 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
#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; \
#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; \
} while(0)
#define remove_monster(x, y) do { \
if (!level.monsters[x][y]) impossible("no monster to remove"); \
level.monsters[x][y] = (struct monst *) 0; \
#define remove_monster(x, y) \
do { \
if (!level.monsters[x][y]) \
impossible("no monster to remove"); \
level.monsters[x][y] = (struct monst *) 0; \
} while(0)
#else
#define place_worm_seg(m, x, y) level.monsters[x][y] = m

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1542765356 2018/11/21 01:55:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.174 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1543052696 2018/11/24 09:44:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.175 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1457,10 +1457,9 @@ boolean at_stairs, falling, portal;
with the situation, so only say something when debugging */
if (wizard)
pline("(monster in hero's way)");
if (!rloc(mtmp, TRUE) || m_at(u.ux, u.uy))
if (!rloc(mtmp, TRUE) || (mtmp = m_at(u.ux, u.uy)) != 0)
/* no room to move it; send it away, to return later */
migrate_to_level(mtmp, ledger_no(&u.uz), MIGR_RANDOM,
(coord *) 0);
m_into_limbo(mtmp);
}
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dog.c $NHDT-Date: 1502753406 2017/08/14 23:30:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.60 $ */
/* NetHack 3.6 dog.c $NHDT-Date: 1543052701 2018/11/24 09:45:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.84 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -224,7 +224,7 @@ update_mlstmv()
void
losedogs()
{
register struct monst *mtmp, *mtmp0 = 0, *mtmp2;
register struct monst *mtmp, *mtmp0, *mtmp2;
int dismissKops = 0;
/*
@@ -279,17 +279,26 @@ losedogs()
mon_arrive(mtmp, TRUE);
}
/* time for migrating monsters to arrive */
/* time for migrating monsters to arrive;
monsters who belong on this level but fail to arrive get put
back onto the list (at head), so traversing it is tricky */
for (mtmp = migrating_mons; mtmp; mtmp = mtmp2) {
mtmp2 = mtmp->nmon;
if (mtmp->mux == u.uz.dnum && mtmp->muy == u.uz.dlevel) {
if (mtmp == migrating_mons)
/* remove mtmp from migrating_mons list */
if (mtmp == migrating_mons) {
migrating_mons = mtmp->nmon;
else
mtmp0->nmon = mtmp->nmon;
} else {
for (mtmp0 = migrating_mons; mtmp0; mtmp0 = mtmp0->nmon)
if (mtmp0->nmon == mtmp) {
mtmp0->nmon = mtmp->nmon;
break;
}
if (!mtmp0)
panic("losedogs: can't find migrating mon");
}
mon_arrive(mtmp, FALSE);
} else
mtmp0 = mtmp;
}
}
}
@@ -300,9 +309,9 @@ struct monst *mtmp;
boolean with_you;
{
struct trap *t;
struct obj *obj;
xchar xlocale, ylocale, xyloc, xyflags, wander;
int num_segs;
boolean failed_to_place = FALSE;
mtmp->nmon = fmon;
fmon = mtmp;
@@ -328,7 +337,7 @@ boolean with_you;
xyflags = mtmp->mtrack[0].y;
xlocale = mtmp->mtrack[1].x;
ylocale = mtmp->mtrack[1].y;
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
memset(mtmp->mtrack, 0, sizeof mtmp->mtrack);
if (mtmp == u.usteed)
return; /* don't place steed on the map */
@@ -447,47 +456,13 @@ boolean with_you;
mtmp->mx = 0; /*(already is 0)*/
mtmp->my = xyflags;
if (xlocale) {
if (!mnearto(mtmp, xlocale, ylocale, FALSE))
goto fail_mon_placement;
} else {
if (!rloc(mtmp, TRUE)) {
/*
* Failed to place migrating monster,
* probably because the level is full.
* Dump the monster's cargo and leave the monster dead.
*
* TODO? Put back on migrating_mons list instead so
* that if hero leaves this level and then returns,
* monster will have another chance to arrive.
*/
fail_mon_placement:
while ((obj = mtmp->minvent) != 0) {
obj_extract_self(obj);
obj_no_longer_held(obj);
if (obj->owornmask & W_WEP)
setmnotwielded(mtmp, obj);
obj->owornmask = 0L;
if (xlocale && ylocale)
place_object(obj, xlocale, ylocale);
else if (rloco(obj)) {
if (!get_obj_location(obj, &xlocale, &ylocale, 0))
impossible("Can't find relocated object.");
}
}
/*
* TODO? Maybe switch to make_corpse() [won't be needed if
* we re-migrate as suggested above], probably with new
* CORPSTAT_NOOBJS flag to suppress dragon scales and such.
*/
if (!(mvitals[monsndx(mtmp->data)].mvflags & G_NOCORPSE)
&& !LEVEL_SPECIFIC_NOCORPSE(mtmp->data))
(void) mkcorpstat(CORPSE, mtmp, mtmp->data,
xlocale, ylocale, CORPSTAT_NONE);
mtmp->mx = mtmp->my = 0; /* for mongone, mon is not anywhere */
mongone(mtmp);
}
}
if (xlocale)
failed_to_place = !mnearto(mtmp, xlocale, ylocale, FALSE);
else
failed_to_place = !rloc(mtmp, TRUE);
if (failed_to_place)
m_into_limbo(mtmp); /* try again next time hero comes to this level */
}
/* heal monster for time spent elsewhere */
@@ -708,7 +683,7 @@ xchar tolev; /* destination level */
xchar xyloc; /* MIGR_xxx destination xy location: */
coord *cc; /* optional destination coordinates */
{
register struct obj *obj;
struct obj *obj;
d_level new_lev;
xchar xyflags;
int num_segs = 0; /* count of worm segments */
@@ -717,12 +692,12 @@ coord *cc; /* optional destination coordinates */
set_residency(mtmp, TRUE);
if (mtmp->wormno) {
register int cnt;
int cnt = count_wsegs(mtmp);
/* **** NOTE: worm is truncated to # segs = max wormno size **** */
cnt = count_wsegs(mtmp);
num_segs = min(cnt, MAX_NUM_WORMS - 1);
wormgone(mtmp);
place_monster(mtmp, mtmp->mx, mtmp->my);
num_segs = min(cnt, MAX_NUM_WORMS - 1); /* used below */
wormgone(mtmp); /* destroys tail and takes head off map */
place_monster(mtmp, mtmp->mx, mtmp->my); /* put head back for relmon */
}
/* set minvent's obj->no_charge to 0 */
@@ -755,7 +730,7 @@ coord *cc; /* optional destination coordinates */
mtmp->muy = new_lev.dlevel;
mtmp->mx = mtmp->my = 0; /* this implies migration */
if (mtmp == context.polearm.hitmon)
context.polearm.hitmon = NULL;
context.polearm.hitmon = (struct monst *) 0;
}
/* return quality of food; the lower the better */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1539479657 2018/10/14 01:14:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.260 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1543052701 2018/11/24 09:45:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.270 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1618,8 +1618,9 @@ struct monst *mon;
struct monst **monst_list; /* &migrating_mons or &mydogs or null */
{
struct monst *mtmp;
boolean unhide = (monst_list != 0);
int mx = mon->mx, my = mon->my;
boolean on_map = (m_at(mx, my) == mon),
unhide = (monst_list != 0);
if (!fmon)
panic("relmon: no fmon available.");
@@ -1633,10 +1634,12 @@ struct monst **monst_list; /* &migrating_mons or &mydogs or null */
seemimic(mon);
}
if (mon->wormno)
remove_worm(mon);
else
remove_monster(mx, my);
if (on_map) {
if (mon->wormno)
remove_worm(mon);
else
remove_monster(mx, my);
}
if (mon == fmon) {
fmon = fmon->nmon;
@@ -1652,7 +1655,8 @@ struct monst **monst_list; /* &migrating_mons or &mydogs or null */
}
if (unhide) {
newsym(mx, my);
if (on_map)
newsym(mx, my);
/* insert into mydogs or migrating_mons */
mon->nmon = *monst_list;
*monst_list = mon;
@@ -2515,7 +2519,7 @@ struct monst *mtmp;
{
unstuck(mtmp);
mdrop_special_objs(mtmp);
migrate_to_level(mtmp, ledger_no(&u.uz), MIGR_APPROX_XY, NULL);
migrate_to_level(mtmp, ledger_no(&u.uz), MIGR_APPROX_XY, (coord *) 0);
}
/* make monster mtmp next to you (if possible);

View File

@@ -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

View File

@@ -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

View File

@@ -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));
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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),"