From 6a085955ea05559f7ad405a42b1b00640f292929 Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Wed, 13 Dec 2023 19:13:40 +0200 Subject: [PATCH] src/eat: Check for valid corpsenm before checking is_rider corpsenm can be -1 so limit checking is_rider with only >= LOW_PM corpse numbers. --- src/eat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/eat.c b/src/eat.c index 4668cef36..020292440 100644 --- a/src/eat.c +++ b/src/eat.c @@ -57,7 +57,8 @@ static int tin_ok(struct obj *); they can be sacrificed regardless of age which implies that they never become rotten */ #define nonrotting_corpse(mnum) \ - ((mnum) == PM_LIZARD || (mnum) == PM_LICHEN || is_rider(&mons[mnum]) \ + ((mnum) == PM_LIZARD || (mnum) == PM_LICHEN \ + || ((mnum) >= LOW_PM && is_rider(&mons[mnum])) \ || (mnum) == PM_ACID_BLOB) /* non-rotting non-corpses; unlike lizard corpses, these items will behave