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.
This commit is contained in:
Mika Kuoppala
2023-12-13 19:13:40 +02:00
committed by PatR
parent 5cfa4cd9f6
commit 6a085955ea

View File

@@ -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