From 82d83dc83d10c744c0f05eecb2a60ebbf22d55ee Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 29 Aug 2023 00:45:11 -0700 Subject: [PATCH] \#wizkill vs dmonsfree When testing the high priest livelog/#chronicle feedback I used #wizkill on the Sanctum level to kill Moloch's high priestess and immediately level teleported to the Astral level to target the other high priests. I got impossible "dmonsfree: 0 removed doesn't match 1 pending" there. --- doc/fixes3-7-0.txt | 3 +++ src/cmd.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 4c4221a88..5aabb2fe3 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1664,6 +1664,9 @@ status_hilite rule for critical-hp takes precedence over up/down/changed HP livelog/#chronicle of multiple high priests reported their deaths as "killed high priest" and "killed high priest (2nd time)" instead of "killed high priest of Foo" and "killed high priest of Bar" +using wizard mode #wizkill outside the endgame followed by m^V to enter the + endgame without any intervening moves would result in impossible + "dmonsfree: 0 removed doesn't match N pending on " Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository diff --git a/src/cmd.c b/src/cmd.c index 03d69d889..93e7a9bc0 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1388,6 +1388,13 @@ wiz_kill(void) break; } } + /* since #wizkill takes no game time, it is possible to kill something + in the main dungeon and immediately level teleport into the endgame + which will delete the main dungeon's level files; avoid triggering + impossible "dmonsfree: 0 removed doesn't match N pending" by forcing + dead monster cleanup; we don't track whether anything was actually + killed above--if nothing was, this will be benign */ + dmonsfree(); /* distinction between ECMD_CANCEL and ECMD_OK is unimportant here */ return ECMD_OK; /* no time elapses */ }