Add a macro to provide universal consistency around the check
for what sort of creatures tend to revive.
This commit is contained in:
@@ -129,6 +129,9 @@
|
||||
(ptr) == &mons[PM_GIANT] || \
|
||||
(ptr) == &mons[PM_ELF] || \
|
||||
(ptr) == &mons[PM_HUMAN])
|
||||
/* return TRUE if the monster tends to revive */
|
||||
#define is_reviver(ptr) (is_rider(ptr) || (ptr)->mlet == S_TROLL)
|
||||
|
||||
/* this returns the light's range, or 0 if none; if we add more light emitting
|
||||
monsters, we'll likely have to add a new light range field to mons[] */
|
||||
#define emits_light(ptr) (((ptr)->mlet == S_LIGHT || \
|
||||
|
||||
@@ -2155,7 +2155,7 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */
|
||||
/* hatching eggs don't merge; ditto for revivable corpses */
|
||||
if ((obj->otyp == EGG && (obj->timed || otmp->timed)) ||
|
||||
(obj->otyp == CORPSE && otmp->corpsenm >= LOW_PM &&
|
||||
mons[otmp->corpsenm].mlet == S_TROLL))
|
||||
is_reviver(&mons[otmp->corpsenm])))
|
||||
return FALSE;
|
||||
|
||||
/* allow candle merging only if their ages are close */
|
||||
|
||||
@@ -100,11 +100,8 @@ STATIC_VAR short cham_to_pm[] = {
|
||||
PM_SANDESTIN,
|
||||
};
|
||||
|
||||
/* return TRUE if the monster tends to revive */
|
||||
#define REVIVER(ptr) (is_rider(ptr) || ptr->mlet == S_TROLL)
|
||||
|
||||
#define KEEPTRAITS(mon) (mon->isshk || mon->mtame || \
|
||||
(mon->data->geno & G_UNIQ) || REVIVER(mon->data) || \
|
||||
(mon->data->geno & G_UNIQ) || is_reviver(mon->data) || \
|
||||
(mon->m_id == quest_status.leader_m_id))
|
||||
|
||||
/* Creates a monster corpse, a "special" corpse, or nothing if it doesn't
|
||||
|
||||
Reference in New Issue
Block a user