diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 04bfb07b4..721aa16a1 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1443 $ $NHDT-Date: 1717878584 2024/06/08 20:29:44 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1445 $ $NHDT-Date: 1718303201 2024/06/13 18:26:41 $ General Fixes and Modified Features ----------------------------------- @@ -1957,6 +1957,9 @@ omit "a" from "drowned in a limitless water" when drowning on Plane of Water restoring a save file could trigger impossible "rnd(0) attempted" if it tried to make an unhidden mimic hide as an object; if the code was marked as a released version, it would crash due to divide by 0 error instead +fix regression of a post-3.6 fix: if 2 Wizards of Yendor were in play and 1 + escaped the dungeon, bookkeeping for current number of Wizards stayed + at 2, interferring with future Wizard behavior Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/include/extern.h b/include/extern.h index 9292fb79d..b746f6d6b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 extern.h $NHDT-Date: 1713334799 2024/04/17 06:19:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1420 $ */ +/* NetHack 3.7 extern.h $NHDT-Date: 1718303205 2024/06/13 18:26:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1426 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3702,7 +3702,7 @@ extern int pick_nasty(int); extern int nasty(struct monst *) NO_NNARGS; extern void resurrect(void); extern void intervene(void); -extern void wizdead(void); +extern void wizdeadorgone(void); extern void cuss(struct monst *) NONNULLARG1; /* ### wizcmds.c ### */ diff --git a/src/mon.c b/src/mon.c index 910ad18b0..8ccc581a8 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mon.c $NHDT-Date: 1717570485 2024/06/05 06:54:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.573 $ */ +/* NetHack 3.7 mon.c $NHDT-Date: 1718303201 2024/06/13 18:26:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.576 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2678,13 +2678,15 @@ m_detach( mon_leaving_level(mtmp); mtmp->mhp = 0; /* simplify some tests: force mhp to 0 */ + /* death handling for the Wizard needs to take place even if he is + leaving the dungeon alive rather than dying */ + if (mtmp->iswiz) + wizdeadorgone(); /* foodead() might give quest feedback for foo having died; skip that if we're called for mongone() rather than mondead(); saving bones or wizard mode genocide of "*" can result in special monsters going away without having been killed */ if (due_to_death) { - if (mtmp->iswiz) - wizdead(); if (mtmp->data->msound == MS_NEMESIS) { nemdead(); /* The Archeologist, Caveman, and Priest quest texts describe diff --git a/src/spell.c b/src/spell.c index f1fd18270..f4c356e31 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 spell.c $NHDT-Date: 1715984438 2024/05/17 22:20:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.169 $ */ +/* NetHack 3.7 spell.c $NHDT-Date: 1718303203 2024/06/13 18:26:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.171 $ */ /* Copyright (c) M. Stephenson 1988 */ /* NetHack may be freely redistributed. See license for details. */ @@ -283,8 +283,7 @@ deadbook(struct obj *book2) are not artifacts */ pline("At least one of your relics is cursed..."); } else if (arti1_primed && arti2_primed) { - unsigned soon = - (unsigned) d(2, 6); /* time til next intervene() */ + unsigned soon = (unsigned) d(2, 6); /* time til next intervene() */ /* successful invocation */ mkinvokearea(); @@ -292,7 +291,7 @@ deadbook(struct obj *book2) record_achievement(ACH_INVK); /* in case you haven't killed the Wizard yet, behave as if you just did */ - u.uevent.udemigod = 1; /* wizdead() */ + u.uevent.udemigod = 1; /* wizdeadorgone() */ if (!u.udg_cnt || u.udg_cnt > soon) u.udg_cnt = soon; } else { /* at least one relic not prepared properly */ diff --git a/src/wizard.c b/src/wizard.c index 0a35f66f9..0989f9b20 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 wizard.c $NHDT-Date: 1705357487 2024/01/15 22:24:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.105 $ */ +/* NetHack 3.7 wizard.c $NHDT-Date: 1718303204 2024/06/13 18:26:44 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.110 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2016. */ /* NetHack may be freely redistributed. See license for details. */ @@ -793,8 +793,10 @@ intervene(void) } } +/* Wizard of Yendor is being removed from play (dead or escaped the dungeon); + keep the bookkeeping for him up to date */ void -wizdead(void) +wizdeadorgone(void) { gc.context.no_of_wizards--; if (!u.uevent.udemigod) {