replace x >= LOW_PM with ismnum(x) shorthand macro

This commit is contained in:
nhmall
2024-01-11 14:01:10 -05:00
parent 58031920dc
commit 25a8c258e6
31 changed files with 119 additions and 107 deletions
+2 -2
View File
@@ -933,7 +933,7 @@ dogfood(struct monst *mon, struct obj *obj)
? obj->corpsenm
: NON_PM;
/* mons[NUMMONS] is valid; predicate tests against it will fail */
fptr = &mons[(fx >= LOW_PM) ? fx : NUMMONS];
fptr = &mons[(ismnum(fx)) ? fx : NUMMONS];
if (obj->otyp == CORPSE && is_rider(fptr))
return TABU;
@@ -1103,7 +1103,7 @@ tamedog(struct monst *mtmp, struct obj *obj)
/* pet will "catch" and eat this thrown food */
if (canseemon(mtmp)) {
boolean big_corpse =
(obj->otyp == CORPSE && obj->corpsenm >= LOW_PM
(obj->otyp == CORPSE && ismnum(obj->corpsenm)
&& mons[obj->corpsenm].msize > mtmp->data->msize);
pline("%s catches %s%s", Monnam(mtmp), the(xname(obj)),
!big_corpse ? "." : ", or vice versa!");