fix issue #333 - obsolete "green slime corpse"

Issue was for dropping glob of green slime while swallowed by a
purple worm but also applied to pet eating habits.  Green slime
corpse doesn't exist any more; check for glob instead.

Fixes #333
This commit is contained in:
PatR
2020-04-23 17:31:21 -07:00
parent ff483694af
commit 6677003c8f
4 changed files with 15 additions and 13 deletions

View File

@@ -804,21 +804,17 @@ register struct obj *obj;
|| (acidic(fptr) && !resists_acid(mon))
|| (poisonous(fptr) && !resists_poison(mon)))
return POISON;
/* turning into slime is preferable to starvation */
else if (fptr == &mons[PM_GREEN_SLIME] && !slimeproof(mon->data))
return starving ? ACCFOOD : POISON;
/* polymorphing is preferable to starvation, and the pet might also
* want to take their chances on it if they've been mistreated */
/* polymorphing is preferable to starvation, and pet might also
want to take its chances on that if they've been mistreated */
else if (is_shapeshifter(fptr)) {
if (mon->mtame == 1) {
/* A herbivore still won't eat a nonvegan corpse, but in any
* other circumstance a pet with tameness 1 will happily eat
* a shapeshifter. */
/* A herbivore still won't eat a nonvegan corpse, but
in any other circumstance a pet with tameness 1 will
happily eat a shapeshifter. */
return (herbi && !vegan(fptr)) ? MANFOOD : CADAVER;
}
return starving ? ACCFOOD : MANFOOD;
}
else if (vegan(fptr))
} else if (vegan(fptr))
return herbi ? CADAVER : MANFOOD;
/* most humanoids will avoid cannibalism unless starving;
arbitrary: elves won't eat other elves even then */
@@ -828,6 +824,9 @@ register struct obj *obj;
return (starving && carni && !is_elf(mptr)) ? ACCFOOD : TABU;
else
return carni ? CADAVER : MANFOOD;
case GLOB_OF_GREEN_SLIME: /* other globs use the default case */
/* turning into slime is preferable to starvation */
return (starving || slimeproof(mon->data)) ? ACCFOOD : POISON;
case CLOVE_OF_GARLIC:
return (is_undead(mptr) || is_vampshifter(mon))
? TABU