]> granicus.if.org Git - nethack/commitdiff
several fixes for farming changes
authorDerek S. Ray <derekray@gmail.com>
Sun, 5 Apr 2015 22:04:22 +0000 (18:04 -0400)
committerDerek S. Ray <derekray@gmail.com>
Sun, 5 Apr 2015 22:04:22 +0000 (18:04 -0400)
* don't let player wish for multiple globs
* use newsym() to clean up merged globs on floor
* food effects should match original corpse effects
* tidy up remaining crash when merging in place

doc/fixes35.0
src/do.c
src/eat.c
src/mkobj.c
src/objnam.c

index 46b87d58f3877bc6df3006a885e6fabfbb8a1760..a13f955c4dcc22717fd0facb9edfc393235b4825 100644 (file)
@@ -894,6 +894,8 @@ non-pet rust monsters would eat rust-proofed non-digestibles but ignore
        those non-digestibles otherwise
 kicking a grave may topple the gravestone
 allow showing legal jumping positions when asked for location to jump to
+cloned creatures (of any type) don't deathdrop items
+pudding corpses behave somewhat differently than before
 
 
 Platform- and/or Interface-Specific Fixes
index fcb77525e01423d623fd491525357b82fa1328ba..5b27d283f93472cca91e7790588f0f0e3670afcf 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -217,8 +217,8 @@ const char *verb;
         while (obj && (otmp = obj_nexto_xy(obj->otyp, x, y, obj->o_id)) != (struct obj*)0) {
             pline("The %s coalesce.", makeplural(obj_typename(obj->otyp)));
             obj_meld(&obj, &otmp);
-            return (obj == NULL); 
         }
+        return (obj == NULL); 
     }
     return FALSE;
 }
index cb92f16c1768a4c9bd3d7590039589e1b1256fb7..ea3f77691035011206ac558d3b43518b75670d22 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1612,7 +1612,7 @@ start_eating(otmp)                /* called as you start to eat */
        context.victual.fullwarn = context.victual.doreset = FALSE;
        context.victual.eating = TRUE;
 
-       if (otmp->otyp == CORPSE) {
+       if (otmp->otyp == CORPSE || otmp->globby) {
            cprefx(context.victual.piece->corpsenm);
            if (!context.victual.piece || !context.victual.eating) {
                /* rider revived, or died and lifesaved */
@@ -2127,7 +2127,7 @@ struct obj *otmp;
                                !Stone_resistance &&
                                !poly_when_stoned(youmonst.data));
 
-               if (mnum == PM_GREEN_SLIME)
+               if (mnum == PM_GREEN_SLIME || otmp->otyp == GLOB_OF_GREEN_SLIME)
                    stoneorslime = (!Unchanging && !slimeproof(youmonst.data));
 
                if (cadaver && !nonrotting_corpse(mnum)) {
@@ -2397,7 +2397,7 @@ doeat()           /* generic "eat" command funtion (see cmd.c) */
         * for normal vs. rotten food.  The reqtime and nutrit values are
         * then adjusted in accordance with the amount of food left.
         */
-       if(otmp->otyp == CORPSE) {
+       if(otmp->otyp == CORPSE || otmp->globby) {
            int tmp = eatcorpse(otmp);
            if (tmp == 2) {
                /* used up */
index 4985a87a0ba8db5c59ca89ca1cf31d0122960c0e..57c735ad38cfc9e35e21f87cc0785f8bba2ce3e6 100644 (file)
@@ -676,6 +676,7 @@ boolean artif;
         if (Is_pudding(otmp)) {
             otmp->globby = 1;
             otmp->known = otmp->bknown = otmp->rknown = otmp->dknown = 1;
+            otmp->corpsenm = PM_GRAY_OOZE + (otmp->otyp - GLOB_OF_GRAY_OOZE);
             /* this ensures that they don't fail merging because of
              * BUC status or other irrelevancies */
         } else {
@@ -2219,7 +2220,9 @@ obj_absorb(obj1, obj2)
             otmp1->oeaten += otmp1->oeaten ? extrawt : 0;
             otmp1->quan = 1;
             obj_extract_self(otmp2);
+            newsym(otmp2->ox, otmp2->oy); /* in case of floor */
             dealloc_obj(otmp2);
+            *obj2 = NULL;
             return otmp1;
         }
     }
index 55ee50c1ba3c9857a3c7cda30a56f53e30fdf569..91d29cababb760523020c1389b9028daf0df18ae 100644 (file)
@@ -2499,11 +2499,18 @@ struct obj *no_wish;
     }
 
     /* intercept pudding globs here; they're a valid wish target,
-     * but we need them to not get treated like a corpse */
-    if (((p = strstri(bp, "glob of ")) != 0) 
-        && (mntmp = name_to_mon(p+8)) >= PM_GRAY_OOZE
-        && mntmp <= PM_BLACK_PUDDING) {
-        mntmp = NON_PM;    /* lie to ourselves */
+     * but we need them to not get treated like a corpse.
+     * 
+     * also don't let player wish for multiple globs. 
+     */
+    if ((p = strstri(bp, "glob of ")) != 0 
+          || (p = strstri(bp, "globs of ")) != 0) {
+        int globoffset = (*(p+4) == 's') ? 9 : 8;
+        if ((mntmp = name_to_mon(p + globoffset)) >= PM_GRAY_OOZE
+                && mntmp <= PM_BLACK_PUDDING) {
+            mntmp = NON_PM;     /* lie to ourselves */
+            cnt = 0;            /* force only one */
+        }
     } else {
         /*
          * Find corpse type using "of" (figurine of an orc, tin of orc meat)