fix part of #S11588 - mons eating poisoned items
Prevent non-poison resistant monsters that eat items from eating poisoned items.
This commit is contained in:
@@ -943,6 +943,8 @@ dogfood(struct monst *mon, struct obj *obj)
|
||||
starving, mblind;
|
||||
int fx;
|
||||
|
||||
if (obj->opoisoned && !resists_poison(mon))
|
||||
return POISON;
|
||||
if (is_quest_artifact(obj) || obj_resists(obj, 0, 95))
|
||||
return obj->cursed ? TABU : APPORT;
|
||||
|
||||
|
||||
@@ -1435,8 +1435,9 @@ meatmetal(struct monst *mtmp)
|
||||
otmp = otmp->nexthere) {
|
||||
/* Don't eat indigestible/choking/inappropriate objects */
|
||||
if ((mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp))
|
||||
|| (otmp->otyp == AMULET_OF_STRANGULATION)
|
||||
|| (otmp->otyp == RIN_SLOW_DIGESTION))
|
||||
|| (otmp->otyp == AMULET_OF_STRANGULATION
|
||||
|| otmp->otyp == RIN_SLOW_DIGESTION)
|
||||
|| (otmp->opoisoned && !resists_poison(mtmp)))
|
||||
continue;
|
||||
if (is_metallic(otmp) && !obj_resists(otmp, 5, 95)
|
||||
&& touch_artifact(otmp, mtmp)) {
|
||||
@@ -1548,6 +1549,7 @@ meatobj(struct monst* mtmp) /* for gelatinous cubes */
|
||||
included for emphasis */
|
||||
|| (otmp->otyp == AMULET_OF_STRANGULATION
|
||||
|| otmp->otyp == RIN_SLOW_DIGESTION)
|
||||
|| (otmp->opoisoned && !resists_poison(mtmp))
|
||||
/* cockatrice corpses handled above; this
|
||||
touch_petrifies() check catches eggs */
|
||||
|| (mstoning(otmp) && !resists_ston(mtmp))
|
||||
|
||||
Reference in New Issue
Block a user