From 15a017c030ceb4b7c8ef78a40351142d17cdca54 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 24 Aug 2026 21:56:18 -0400 Subject: [PATCH] fix undead corpses being edible now In 3.6.x, zombie corpses were always aged an extra 100: NetHack/src/mon.c Line 375 in 23d331a obj->age -= 100; /* this is an *OLD* corpse */ in 5.0.x, zombie corpses are always aged TAINT_AGE, which is only 50: NetHack/src/mon.c Line 648 in 97a6c13 obj->age -= (TAINT_AGE + 1); /* this is an *OLD* corpse */ This is the result of commit 408321b. The accompanying comment states that the purpose of that patch was meant to just replace hard-coded numbers with symbolic values, but the commit set two differing numeric values to the same symbol name, thus causing the regression reported in: https://github.com/NetHack/NetHack/issues/1664 Revert the values to match those of 3.6, and add the additional symbolic value. Closes #1664 --- doc/fixes5-0-1.txt | 1 + include/hack.h | 3 ++- src/mklev.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/fixes5-0-1.txt b/doc/fixes5-0-1.txt index 6e1c22cc1..3ae31483f 100644 --- a/doc/fixes5-0-1.txt +++ b/doc/fixes5-0-1.txt @@ -87,6 +87,7 @@ upon return to a level, catch up on remaining nutrition value by the same percentage as the catch up for the weight after polymorph or revival from corpse, monsters were not interacting with the terrain until that monster's next move +fix undead corpses (zombies, etc.) now being edible Platform- and/or Interface-Specific Fixes diff --git a/include/hack.h b/include/hack.h index a7c28315d..cc7a0e5b5 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1417,7 +1417,8 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */ #define HEALTHY_TIN (-3) /* Corpse aging */ -#define TAINT_AGE (50L) /* age when corpses go bad */ +#define INEDIBLE_AGE (50L) /* age when corpses go bad */ +#define TAINT_AGE (100L) /* This was the 3.6 value */ #define TROLL_REVIVE_CHANCE 37 /* 1/37 chance for 50 turns ~ 75% chance */ #define ROT_AGE (250L) /* age when corpses rot away */ diff --git a/src/mklev.c b/src/mklev.c index c3d7a8a54..210dd90ce 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1934,7 +1934,7 @@ mktrap_victim(struct trap *ttmp) if (victim_mnum == PM_HUMAN && rn2(25)) victim_mnum = rn1(PM_WIZARD - PM_ARCHEOLOGIST, PM_ARCHEOLOGIST); otmp = mkcorpstat(CORPSE, NULL, &mons[victim_mnum], x, y, CORPSTAT_INIT); - otmp->age -= (TAINT_AGE + 1); /* died too long ago to safely eat */ + otmp->age -= (INEDIBLE_AGE + 1); /* died too long ago to safely eat */ } /* pick a random trap type, return NO_TRAP if "too hard" */