From 7fa44992f91aed0b119265845de36dd0e76730bd Mon Sep 17 00:00:00 2001 From: karnov Date: Fri, 1 May 2015 22:36:17 -0400 Subject: [PATCH 1/4] sysconf fixes --- sys/unix/hints/linux | 4 ++++ sys/unix/hints/linux-x11 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index 3ae677d00..8f3d7f3db 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -15,6 +15,10 @@ PREFIX=$(wildcard ~)/nh/install HACKDIR=$(PREFIX)/games/lib/$(GAME)dir SHELLDIR = $(PREFIX)/games + + +POSTINSTALL=cp -n sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; + CFLAGS=-g -O -I../include -DNOTPARMDECL $(CFLAGS1) -DDLB CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index cf5dfb6f3..42600eb76 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -15,6 +15,10 @@ PREFIX=$(wildcard ~)/nh/install HACKDIR=$(PREFIX)/games/lib/$(GAME)dir SHELLDIR = $(PREFIX)/games + +POSTINSTALL= cp -n sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf; +POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir); + CFLAGS=-O -I../include -DNOTPARMDECL $(CFLAGS1) $(CFLAGS3) CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" From 490092d3ef74ed4a8688e124606065537ff04834 Mon Sep 17 00:00:00 2001 From: karnov Date: Sun, 3 May 2015 22:03:09 -0400 Subject: [PATCH 2/4] Made sysconf define contiditional to ensure no double inclusion. --- include/config.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/config.h b/include/config.h index 5fc3d0d8f..afd6ed64d 100644 --- a/include/config.h +++ b/include/config.h @@ -176,8 +176,10 @@ # define WIZARD_NAME "wizard" #endif -/* #define SYSCF */ /* use a global configuration */ -/* #define SYSCF_FILE "sysconf" */ /* global configuration is in a file */ +#ifndef SYSCF +#define SYSCF /* use a global configuration */ +#define SYSCF_FILE "sysconf" /* global configuration is in a file */ +#endif #ifndef GDBPATH # define GDBPATH "/usr/bin/gdb" From e2e269504cb07f457b1edb9e390285840af67c79 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 4 May 2015 08:49:21 -0700 Subject: [PATCH 3/4] more "deleting worn obj" Lit candles and burning potions of oil can be on the migrating objects list and get deleted before arrival, so they need the same cleanup as rotting corpses to prevent obfree from complaining that they're worn. --- src/timeout.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/timeout.c b/src/timeout.c index e1ccaf96e..4146df967 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 timeout.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 timeout.c $NHDT-Date: 1430754548 2015/05/04 15:49:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.55 $ */ /* NetHack 3.5 timeout.c $Date: 2012/04/16 00:57:37 $ $Revision: 1.48 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -817,7 +817,8 @@ long timeout; obj->spe = 0; /* no more candles */ } else if (Is_candle(obj) || obj->otyp == POT_OIL) { /* get rid of candles and burning oil potions; - we know this object isn't carried by hero */ + we know this object isn't carried by hero, + nor is it migrating */ obj_extract_self(obj); obfree(obj, (struct obj *)0); obj = (struct obj *) 0; @@ -861,6 +862,9 @@ long timeout; if (carried(obj)) { useupall(obj); } else { + /* clear migrating obj's destination code before obfree + to avoid false complaint of deleting worn item */ + if (obj->where == OBJ_MIGRATING) obj->owornmask = 0L; obj_extract_self(obj); obfree(obj, (struct obj *)0); } @@ -1037,6 +1041,10 @@ long timeout; if (carried(obj)) { useupall(obj); } else { + /* clear migrating obj's destination code + so obfree won't think this item is worn */ + if (obj->where == OBJ_MIGRATING) + obj->owornmask = 0L; obj_extract_self(obj); obfree(obj, (struct obj *)0); } From 766d874a470e77e795a145fd0fdc1fd70623b2a4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 4 May 2015 22:19:27 +0300 Subject: [PATCH 4/4] Melded pudding object may be gone --- src/do.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/do.c b/src/do.c index 3962e6d01..d85859353 100644 --- a/src/do.c +++ b/src/do.c @@ -218,7 +218,7 @@ const char *verb; /* Globby things like puddings might stick together */ while (obj && (otmp = obj_nexto_xy(obj->otyp, x, y, obj->o_id)) != (struct obj*)0) { pudding_merge_message(obj, otmp); - obj_meld(&obj, &otmp); + obj = obj_meld(&obj, &otmp); } return (obj == NULL); }