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
This commit is contained in:
nhmall
2026-08-24 21:56:18 -04:00
parent 97a6c131a9
commit 15a017c030
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -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 percentage as the catch up for the weight
after polymorph or revival from corpse, monsters were not interacting with after polymorph or revival from corpse, monsters were not interacting with
the terrain until that monster's next move the terrain until that monster's next move
fix undead corpses (zombies, etc.) now being edible
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+2 -1
View File
@@ -1417,7 +1417,8 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
#define HEALTHY_TIN (-3) #define HEALTHY_TIN (-3)
/* Corpse aging */ /* 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 TROLL_REVIVE_CHANCE 37 /* 1/37 chance for 50 turns ~ 75% chance */
#define ROT_AGE (250L) /* age when corpses rot away */ #define ROT_AGE (250L) /* age when corpses rot away */
+1 -1
View File
@@ -1934,7 +1934,7 @@ mktrap_victim(struct trap *ttmp)
if (victim_mnum == PM_HUMAN && rn2(25)) if (victim_mnum == PM_HUMAN && rn2(25))
victim_mnum = rn1(PM_WIZARD - PM_ARCHEOLOGIST, PM_ARCHEOLOGIST); victim_mnum = rn1(PM_WIZARD - PM_ARCHEOLOGIST, PM_ARCHEOLOGIST);
otmp = mkcorpstat(CORPSE, NULL, &mons[victim_mnum], x, y, CORPSTAT_INIT); 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" */ /* pick a random trap type, return NO_TRAP if "too hard" */