From: PatR Date: Fri, 7 May 2021 18:58:58 +0000 (-0700) Subject: fix pull request #505 - undead turning X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd6ed5026bf3465a8b6427913b6dea35008672e2;p=nethack fix pull request #505 - undead turning zapped at corpse flagged as "no revive". A fairly recent change made undead turning override no-revive if it hit someone carrying a corpse flagged that way (corpse of a troll killed by Trollsbane or stuffed in an ice box or explicitly cancelled) but neglected to do so for corpses zapped while on the floor. This fixes that, for undead turning zapped by monsters as well as by the hero. Fixes #505 --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 284ccc8cf..e0c478227 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.526 $ $NHDT-Date: 1620348705 2021/05/07 00:51:45 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.527 $ $NHDT-Date: 1620413928 2021/05/07 18:58:48 $ General Fixes and Modified Features ----------------------------------- @@ -655,6 +655,8 @@ if a corpse was set to revive as a zombie and corpse was partly nutrition that zombie, oeaten_stat() could give the warning "partly eaten food more nutritious than untouched food" when used to calculate zombie's hit points (depended upon how much had been eaten) +undead turning magic revived corpses flagged as no-revive if they were being + carried but not if they were zapped while on the floor curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/zap.c b/src/zap.c index a3fb0884a..bbd1e5af8 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 zap.c $NHDT-Date: 1596498233 2020/08/03 23:43:53 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.346 $ */ +/* NetHack 3.7 zap.c $NHDT-Date: 1620413928 2021/05/07 18:58:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.360 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2101,6 +2101,7 @@ bhito(struct obj *obj, struct obj *otmp) } else if (obj->otyp == CORPSE) { struct monst *mtmp; xchar ox, oy; + unsigned save_norevive; boolean by_u = !g.context.mon_moving; int corpsenm = corpse_revive_type(obj); char *corpsname = cxname_singular(obj); @@ -2109,8 +2110,13 @@ bhito(struct obj *obj, struct obj *otmp) if (!get_obj_location(obj, &ox, &oy, 0)) ox = obj->ox, oy = obj->oy; /* won't happen */ + /* explicit revival magic overrides timer-based no-revive */ + save_norevive = obj->norevive; + obj->norevive = 0; + mtmp = revive(obj, TRUE); if (!mtmp) { + obj->norevive = save_norevive; res = 0; /* no monster implies corpse was left intact */ } else { if (cansee(ox, oy)) {