fix github issue #273 - named orc mummy

The test for whether a migrating object generated as plundered
mine-town loot should be delivered to any orc created and then giving
that orc a bandit name was kicking in for orc mummies and orc zombies
as well as for regular orcs.

Also, the loot could include tins or eggs and their species would
get clobbered by the overloading of obj->corpsenm.  During delivery
when the overloading was reset they would become giant ant eggs/tins.
(Not seen in actual play.)
This commit is contained in:
PatR
2019-12-29 18:55:44 -08:00
parent e4221db47e
commit 31fadff2c1
3 changed files with 21 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dokick.c $NHDT-Date: 1575245057 2019/12/02 00:04:17 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.136 $ */
/* NetHack 3.6 dokick.c $NHDT-Date: 1577674533 2019/12/30 02:55:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.152 $ */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1706,6 +1706,9 @@ unsigned long deliverflags;
else
maxobj = 1;
#define DELIVER_PM (M2_UNDEAD | M2_WERE | M2_HUMAN | M2_ELF | M2_DWARF \
| M2_GNOME | M2_ORC | M2_DEMON | M2_GIANT)
cnt = 0;
for (otmp = g.migrating_objs; otmp; otmp = otmp2) {
otmp2 = otmp->nobj;
@@ -1713,7 +1716,7 @@ unsigned long deliverflags;
if ((where & MIGR_TO_SPECIES) == 0)
continue;
if ((mtmp->data->mflags2 & otmp->corpsenm) != 0) {
if ((mtmp->data->mflags2 & DELIVER_PM) == otmp->corpsenm) {
obj_extract_self(otmp);
otmp->owornmask = 0L;
otmp->ox = otmp->oy = 0;
@@ -1730,7 +1733,7 @@ unsigned long deliverflags;
}
free_oname(otmp);
}
otmp->corpsenm = 0;
otmp->corpsenm = NON_PM;
(void) add_to_minv(mtmp, otmp);
cnt++;
if (maxobj && cnt >= maxobj)