replace x >= LOW_PM with ismnum(x) shorthand macro
This commit is contained in:
@@ -285,4 +285,7 @@ struct monst {
|
||||
#define is_lminion(mon) \
|
||||
(is_minion((mon)->data) && mon_aligntyp(mon) == A_LAWFUL)
|
||||
|
||||
/* x is a valid index into mons[] array */
|
||||
#define ismnum(x) ((x) >= LOW_PM && (x) < NUMMONS)
|
||||
|
||||
#endif /* MONST_H */
|
||||
|
||||
@@ -13,6 +13,13 @@ enum monnums {
|
||||
NUMMONS,
|
||||
NON_PM = -1, /* "not a monster */
|
||||
LOW_PM = NON_PM + 1, /* first monster in mons */
|
||||
LEAVESTATUE = NON_PM - 1, /* leave statue instead of corpse;
|
||||
* there are two lower values assigned
|
||||
* in end.c so that (x == LEAVESTATUE)
|
||||
* will test FALSE in bones.c:
|
||||
* (NON_PM - 2) for no corpse
|
||||
* (NON_PM - 3) for no corpse, no grave */
|
||||
HIGH_PM = NUMMONS - 1,
|
||||
SPECIAL_PM = PM_LONG_WORM_TAIL /* [normal] < ~ < [special] */
|
||||
/* mons[SPECIAL_PM] through mons[NUMMONS-1], inclusive, are
|
||||
never generated randomly and cannot be polymorphed into */
|
||||
|
||||
Reference in New Issue
Block a user