fix #H9298 - corpse mismatch
Corpses for dying monsters were being created with the wrong type,
caused by incorrect block nesting for 'if (ptr)' from commit
ad302fb8a9 (Oct 10).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.128 $ $NHDT-Date: 1570652307 2019/10/09 20:18:27 $
|
||||
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.132 $ $NHDT-Date: 1570872701 2019/10/12 09:31:41 $
|
||||
|
||||
This fixes36.3 file is here to capture information about updates in the 3.6.x
|
||||
lineage following the release of 3.6.2 in May 2019. Please note, however,
|
||||
@@ -201,6 +201,7 @@ monster throwing from stack of missiles (darts, daggers, spears) would cause
|
||||
crash if it wasn't wielding a weapon (bug in multi-shot shooting fix)
|
||||
surviving death while polymorphed would yield "You are a <foo>" without
|
||||
terminating period
|
||||
'mksobj failure' commit resulted in wrong corpse types for dying monsters
|
||||
curses: sometimes the message window would show a blank line after a prompt
|
||||
curses: the change to show map in columns 1..79 instead of 2..80 made the
|
||||
highlight for '@' show up in the wrong place if clipped map had been
|
||||
|
||||
16
src/mkobj.c
16
src/mkobj.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1570754586 2019/10/11 00:43:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.154 $ */
|
||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1570872702 2019/10/12 09:31:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.155 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1540,18 +1540,20 @@ unsigned corpstatflags;
|
||||
otmp = mksobj_at(objtype, x, y, init, FALSE);
|
||||
}
|
||||
|
||||
/* when 'mtmp' is non-null make a corpse or statue of that monster,
|
||||
otherwise keep the random type chosen by mksobj() */
|
||||
/* when 'mtmp' is non-null save the monster's details with the
|
||||
corpse or statue; it will also force the 'ptr' override below */
|
||||
if (mtmp) {
|
||||
int old_corpsenm = otmp->corpsenm;
|
||||
|
||||
/* save_mtraits updates otmp->oextra->omonst in place */
|
||||
(void) save_mtraits(otmp, mtmp);
|
||||
|
||||
/* when 'ptr' is non-null use the type specified by our caller,
|
||||
otherwise use the monster's species for the corpse */
|
||||
if (!ptr)
|
||||
ptr = mtmp->data;
|
||||
}
|
||||
|
||||
/* when 'ptr' is non-null it comes from our caller or from 'mtmp';
|
||||
override mkobjs()'s initialization of a random monster type */
|
||||
if (ptr) {
|
||||
int old_corpsenm = otmp->corpsenm;
|
||||
|
||||
otmp->corpsenm = monsndx(ptr);
|
||||
otmp->owt = weight(otmp);
|
||||
|
||||
Reference in New Issue
Block a user