-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.518 $ $NHDT-Date: 1619640466 2021/04/28 20:07:46 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.519 $ $NHDT-Date: 1619919402 2021/05/02 01:36:42 $
General Fixes and Modified Features
-----------------------------------
with color enabled, altar wasn't immediately redrawn with new color
repair some regressions to (a)pply introduced by "getobj refactor" patch
fix ^X feedback when held typo: "unseen createure" -> "unseen creature"
+if a <foo> corpse was set to revive as a <foo> zombie and corpse was partly
+ eaten at revival time and monster <foo> is defined as providing more
+ nutrition that <foo> zombie, oeaten_stat() could give the warning
+ "partly eaten food more nutritious than untouched food" when used to
+ calculate zombie's hit points (depended upon how much had been eaten)
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
-/* NetHack 3.7 do.c $NHDT-Date: 1608673689 2020/12/22 21:48:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.256 $ */
+/* NetHack 3.7 do.c $NHDT-Date: 1619919402 2021/05/02 01:36:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.267 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
if (has_omonst(body))
free_omonst(body);
- body->corpsenm = zmon;
+ set_corpsenm(body, zmon);
revive_mon(arg, timeout);
} else {
rot_corpse(arg, timeout);
-/* NetHack 3.7 mkobj.c $NHDT-Date: 1606343579 2020/11/25 22:32:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.191 $ */
+/* NetHack 3.7 mkobj.c $NHDT-Date: 1619919403 2021/05/02 01:36:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.198 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
/*
* Several areas of the code made direct reassignments
- * to obj->corpsenm. Because some special handling is
+ * to obj->corpsenm. Because some special handling is
* required in certain cases, place that handling here
* and call this routine in place of the direct assignment.
*
*
*/
void
-set_corpsenm(struct obj* obj, int id)
+set_corpsenm(struct obj *obj, int id)
{
+ int old_id = obj->corpsenm;
long when = 0L;
if (obj->timed) {
- if (obj->otyp == EGG)
+ if (obj->otyp == EGG) {
when = stop_timer(HATCH_EGG, obj_to_any(obj));
- else {
+ } else {
when = 0L;
obj_stop_timers(obj); /* corpse or figurine */
}
}
+ /* oeaten is used to determine how much nutrition is left in
+ multiple-bite food and also used to derive how many hit points
+ a creature resurrected from a partly eaten corpse gets; latter
+ is of interest when a <foo> corpse revives as a <foo> zombie
+ in case they are defined with different mons[].cnutrit values */
+ if (obj->otyp == CORPSE && obj->oeaten != 0
+ /* when oeaten is non-zero, index old_id can't be NON_PM
+ and divisor mons[old_id].cnutrit can't be zero */
+ && mons[old_id].cnutrit != mons[id].cnutrit) {
+ /* oeaten and cnutrit are unsigned; theoretically that could
+ be 16 bits and the calculation might overflow, so force long */
+ obj->oeaten = (unsigned) ((long) obj->oeaten
+ * (long) mons[id].cnutrit
+ / (long) mons[old_id].cnutrit);
+ }
+
obj->corpsenm = id;
switch (obj->otyp) {
case CORPSE: