fix #K1139 - corpse removed from ice box by monst
Rot and revive timers are turned off when a corpse gets put inside an ice box. They get turned back on when taken out of the ice box by the hero but were being left off if taken out by a monster. That resulted in corpses of arbitrary type behaving like lizard corpses and never rotting away. This fixes that. It also changes troll corpse behavior. Once put in an ice box, a troll corpse will not get a new revive timer when taken out, just an ordinary rot timer.
This commit is contained in:
12
src/mkobj.c
12
src/mkobj.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1585361051 2020/03/28 02:04:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.176 $ */
|
||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1590870787 2020/05/30 20:33:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1148,6 +1148,11 @@ struct obj *body;
|
||||
long corpse_age; /* age of corpse */
|
||||
int rot_adjust;
|
||||
short action;
|
||||
boolean no_revival;
|
||||
|
||||
/* if a troll corpse was frozen, it won't get a revive timer */
|
||||
no_revival = (body->norevive != 0);
|
||||
body->norevive = 0; /* always clear corpse's 'frozen' flag */
|
||||
|
||||
/* lizards and lichen don't rot or revive */
|
||||
if (body->corpsenm == PM_LIZARD || body->corpsenm == PM_LICHEN)
|
||||
@@ -1172,8 +1177,9 @@ struct obj *body;
|
||||
if (!rn2(3))
|
||||
break;
|
||||
|
||||
} else if (mons[body->corpsenm].mlet == S_TROLL && !body->norevive) {
|
||||
} else if (mons[body->corpsenm].mlet == S_TROLL && !no_revival) {
|
||||
long age;
|
||||
|
||||
for (age = 2; age <= TAINT_AGE; age++)
|
||||
if (!rn2(TROLL_REVIVE_CHANCE)) { /* troll revives */
|
||||
action = REVIVE_MON;
|
||||
@@ -1182,8 +1188,6 @@ struct obj *body;
|
||||
}
|
||||
}
|
||||
|
||||
if (body->norevive)
|
||||
body->norevive = 0;
|
||||
(void) start_timer(when, TIMER_OBJECT, action, obj_to_any(body));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user