From 542d1db5f4524e4043887297da34c8faae4e6717 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2026 19:24:40 +0300 Subject: [PATCH] Another fix for #K4317 - monster grudge Undead monsters created by the level creation routine do not grudge other (zombifiable) monsters created during the level creation. This of course doesn't prevent the grudge happening with monsters created during gameplay. Invalidates saves and bones. --- include/monst.h | 3 ++- include/patchlevel.h | 2 +- src/makemon.c | 1 + src/mon.c | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/monst.h b/include/monst.h index f1fb3b9c2..8f189b4b7 100644 --- a/include/monst.h +++ b/include/monst.h @@ -163,7 +163,8 @@ struct monst { Bitfield(mspotted, 1); /* mon is currently seen by hero */ Bitfield(mwandexp, 1); /* mon has experience with wands */ - /* 6 spare bits */ + Bitfield(mgenmklev, 1); /* made by the level generation */ + /* 5 spare bits */ unsigned long mstrategy; /* for monsters with mflag3: current strategy */ #ifdef NHSTDC diff --git a/include/patchlevel.h b/include/patchlevel.h index 0d814189e..d05c2226d 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 134 +#define EDITLEVEL 135 /* * Development status possibilities. diff --git a/src/makemon.c b/src/makemon.c index 4f12e12cb..6f158ee01 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1295,6 +1295,7 @@ makemon( place_monster(mtmp, x, y); mtmp->mcansee = mtmp->mcanmove = TRUE; + mtmp->mgenmklev = gi.in_mklev; mtmp->seen_resistance = M_SEEN_NOTHING; mtmp->mpeaceful = (mmflags & MM_ANGRY) ? FALSE : peace_minded(ptr); if ((mmflags & MM_MINVIS) != 0) /* for ^G */ diff --git a/src/mon.c b/src/mon.c index 627e673bd..c0d92e6c3 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2391,6 +2391,8 @@ mm_2way_aggression(struct monst *magr, struct monst *mdef) them waking up early (e.g. because a zombie decided to attack the Wizard of Yendor). */ if (zombie_maker(magr) && zombie_form(mdef->data) != NON_PM) { + if (magr->mgenmklev && mdef->mgenmklev) + return 0L; if (!Is_stronghold(&u.uz) && !unique_corpstat(magr->data) && !unique_corpstat(mdef->data)) return (ALLOW_M | ALLOW_TM);