src/uhitm: Avoid touch_petrifies with invalid corpsenm
Before checking with touch_petrifies, check that corpsenm is valid (>= LOW_PM)
This commit is contained in:
+2
-1
@@ -1156,7 +1156,8 @@ hmon_hitmon_misc_obj(
|
|||||||
change_luck(-5);
|
change_luck(-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (touch_petrifies(&mons[obj->corpsenm])) {
|
if (obj->corpsenm >= LOW_PM
|
||||||
|
&& touch_petrifies(&mons[obj->corpsenm])) {
|
||||||
/*learn_egg_type(obj->corpsenm);*/
|
/*learn_egg_type(obj->corpsenm);*/
|
||||||
pline("Splat! You hit %s with %s %s egg%s!",
|
pline("Splat! You hit %s with %s %s egg%s!",
|
||||||
mon_nam(mon),
|
mon_nam(mon),
|
||||||
|
|||||||
Reference in New Issue
Block a user