From: Derek S. Ray Date: Sun, 5 Apr 2015 22:04:22 +0000 (-0400) Subject: several fixes for farming changes X-Git-Tag: NetHack-3.6.0_RC01~414^2~41^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3e2772f7b97e30ccd007209d688e872d7cea666;p=nethack several fixes for farming changes * 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 --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 46b87d58f..a13f955c4 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -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 diff --git a/src/do.c b/src/do.c index fcb77525e..5b27d283f 100644 --- 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; } diff --git a/src/eat.c b/src/eat.c index cb92f16c1..ea3f77691 100644 --- 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 */ diff --git a/src/mkobj.c b/src/mkobj.c index 4985a87a0..57c735ad3 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -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; } } diff --git a/src/objnam.c b/src/objnam.c index 55ee50c1b..91d29caba 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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)