src/muse: Avoid touch_petrifies check if bad corpsenm

EGGs can have non permanent monster based corpsenm assigned
(-1). Before doing the touch_petrifies check, make sure
that we have valid corpsenm.
This commit is contained in:
Mika Kuoppala
2023-12-13 19:18:32 +02:00
committed by PatR
parent 4f15e134fc
commit c4d3ca00ce

View File

@@ -2624,7 +2624,7 @@ searches_for_item(struct monst *mon, struct obj *obj)
return (boolean) (mcould_eat_tin(mon)
&& (!resists_ston(mon)
&& cures_stoning(mon, obj, TRUE)));
if (typ == EGG)
if (typ == EGG && obj->corpsenm >= LOW_PM)
return (boolean) touch_petrifies(&mons[obj->corpsenm]);
break;
default: