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;
|
starving, mblind;
|
||||||
int fx;
|
int fx;
|
||||||
|
|
||||||
|
if (obj->opoisoned && !resists_poison(mon))
|
||||||
|
return POISON;
|
||||||
if (is_quest_artifact(obj) || obj_resists(obj, 0, 95))
|
if (is_quest_artifact(obj) || obj_resists(obj, 0, 95))
|
||||||
return obj->cursed ? TABU : APPORT;
|
return obj->cursed ? TABU : APPORT;
|
||||||
|
|
||||||
|
|||||||
@@ -1435,8 +1435,9 @@ meatmetal(struct monst *mtmp)
|
|||||||
otmp = otmp->nexthere) {
|
otmp = otmp->nexthere) {
|
||||||
/* Don't eat indigestible/choking/inappropriate objects */
|
/* Don't eat indigestible/choking/inappropriate objects */
|
||||||
if ((mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp))
|
if ((mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp))
|
||||||
|| (otmp->otyp == AMULET_OF_STRANGULATION)
|
|| (otmp->otyp == AMULET_OF_STRANGULATION
|
||||||
|| (otmp->otyp == RIN_SLOW_DIGESTION))
|
|| otmp->otyp == RIN_SLOW_DIGESTION)
|
||||||
|
|| (otmp->opoisoned && !resists_poison(mtmp)))
|
||||||
continue;
|
continue;
|
||||||
if (is_metallic(otmp) && !obj_resists(otmp, 5, 95)
|
if (is_metallic(otmp) && !obj_resists(otmp, 5, 95)
|
||||||
&& touch_artifact(otmp, mtmp)) {
|
&& touch_artifact(otmp, mtmp)) {
|
||||||
@@ -1548,6 +1549,7 @@ meatobj(struct monst* mtmp) /* for gelatinous cubes */
|
|||||||
included for emphasis */
|
included for emphasis */
|
||||||
|| (otmp->otyp == AMULET_OF_STRANGULATION
|
|| (otmp->otyp == AMULET_OF_STRANGULATION
|
||||||
|| otmp->otyp == RIN_SLOW_DIGESTION)
|
|| otmp->otyp == RIN_SLOW_DIGESTION)
|
||||||
|
|| (otmp->opoisoned && !resists_poison(mtmp))
|
||||||
/* cockatrice corpses handled above; this
|
/* cockatrice corpses handled above; this
|
||||||
touch_petrifies() check catches eggs */
|
touch_petrifies() check catches eggs */
|
||||||
|| (mstoning(otmp) && !resists_ston(mtmp))
|
|| (mstoning(otmp) && !resists_ston(mtmp))
|
||||||
|
|||||||
Reference in New Issue
Block a user