]> granicus.if.org Git - nethack/commitdiff
fix github issue #273 - named orc mummy
authorPatR <rankin@nethack.org>
Mon, 30 Dec 2019 02:55:44 +0000 (18:55 -0800)
committerPatR <rankin@nethack.org>
Mon, 30 Dec 2019 02:55:44 +0000 (18:55 -0800)
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.)

doc/fixes37.0
src/dokick.c
src/mkmaze.c

index dc28569f4ff831fe7c953d9c230712d9f85bfd1f..3fae11bd4e19115055f48c70169a474b4631ffce 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.39 $ $NHDT-Date: 1577662238 2019/12/29 23:30:38 $
+$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.40 $ $NHDT-Date: 1577674533 2019/12/30 02:55:33 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -36,6 +36,8 @@ revised "mysterious force" when climbing out of gehennom could generate
        warnings about "rn2(0) attempted" or "rn2(-n) attempted"
 after 'w' on split stack patch, wielding '-' would cause an object_lost panic
 same patch allowed partial stack from getobj to replace cursed wielded weapon
+if the orc-town version of mine town has been loaded, creation of orc zombies
+       or orc mummies would name them as part of the town raiding orc clan
 
 
 Platform- and/or Interface-Specific Fixes
index 1260f87b6d372b41040045e0f4a4fedf7e492fed..212301d3b3ef7ac68c3e024ee2cc36245784526f 100644 (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)
index 4c0ad75c58a967516f55adc201e76d889edec9bb..7863214de6b1814f806fee54082d4aeb76b65ec9 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 mkmaze.c        $NHDT-Date: 1577568891 2019/12/28 21:34:51 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.103 $ */
+/* NetHack 3.6 mkmaze.c        $NHDT-Date: 1577674536 2019/12/30 02:55:36 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.104 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Pasi Kallinen, 2018. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -699,7 +699,7 @@ const char *gang;
     if (otmp && gang) {
         new_oname(otmp, strlen(gang) + 1); /* removes old name if present */
         Strcpy(ONAME(otmp), gang);
-        if (otyp >= TRIPE_RATION && otyp <= TIN) {
+        if (objects[otyp].oc_class == FOOD_CLASS) {
             if (otyp == SLIME_MOLD)
                 otmp->spe = fruitadd((char *) orcfruit[rn2(SIZE(orcfruit))],
                                      (struct fruit *) 0);
@@ -742,12 +742,16 @@ stolen_booty(VOID_ARGS)
     cnt = rnd(10);
     for (i = 0; i < cnt; ++i) {
         /* Food items - but no lembas! (or some other weird things) */
-        otyp = rn2((TIN - TRIPE_RATION) + 1) + TRIPE_RATION;
-        if (otyp != LEMBAS_WAFER && otyp != GLOB_OF_GRAY_OOZE
-            && otyp != GLOB_OF_BROWN_PUDDING && otyp != GLOB_OF_GREEN_SLIME
-            && otyp != GLOB_OF_BLACK_PUDDING && otyp != MEAT_STICK
-            && otyp != MEATBALL && otyp != MEAT_STICK && otyp != MEAT_RING
-            && otyp != HUGE_CHUNK_OF_MEAT && otyp != CORPSE)
+        otyp = rn1(TIN - TRIPE_RATION + 1, TRIPE_RATION);
+        if (otyp != LEMBAS_WAFER
+            /* exclude meat <anything>, globs of <anything>, kelp
+               which all have random generation probability of 0
+               (K-/C-rations do too, but we want to include those) */
+            && (objects[otyp].oc_prob != 0
+                || otyp == C_RATION || otyp == K_RATION)
+            /* exclude food items which utilize obj->corpsenm because
+               that field is going to be overloaded for delivery purposes */
+            && otyp != CORPSE && otyp != EGG && otyp != TIN)
             migr_booty_item(otyp, gang);
     }
     migr_booty_item(rn2(2) ? LONG_SWORD : SILVER_SABER, gang);