mfrozen sanity check
Add another monster sanity check case: if a monster has the mfrozen counter set to non-zero, make sure that mcanmove is zero.
This commit is contained in:
@@ -97,17 +97,16 @@ sanity_check_single_mon(
|
|||||||
/* bad if not fmon list or if not vault guard */
|
/* bad if not fmon list or if not vault guard */
|
||||||
if (strcmp(msg, "fmon") || !mtmp->isgd)
|
if (strcmp(msg, "fmon") || !mtmp->isgd)
|
||||||
impossible("dead monster on %s; %s at <%d,%d>",
|
impossible("dead monster on %s; %s at <%d,%d>",
|
||||||
msg, mons[mndx].pmnames[NEUTRAL],
|
msg, mptr->pmnames[NEUTRAL], mx, my);
|
||||||
mx, my);
|
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (chk_geno && (gm.mvitals[mndx].mvflags & G_GENOD) != 0)
|
if (chk_geno && (gm.mvitals[mndx].mvflags & G_GENOD) != 0)
|
||||||
impossible("genocided %s in play (%s)",
|
impossible("genocided %s in play (%s)",
|
||||||
pmname(&mons[mndx], Mgender(mtmp)), msg);
|
pmname(mptr, Mgender(mtmp)), msg);
|
||||||
if (mtmp->mtame && !mtmp->mpeaceful)
|
if (mtmp->mtame && !mtmp->mpeaceful)
|
||||||
impossible("tame %s is not peaceful (%s)",
|
impossible("tame %s is not peaceful (%s)",
|
||||||
pmname(&mons[mndx], Mgender(mtmp)), msg);
|
pmname(mptr, Mgender(mtmp)), msg);
|
||||||
}
|
}
|
||||||
if (mtmp->isshk && !has_eshk(mtmp))
|
if (mtmp->isshk && !has_eshk(mtmp))
|
||||||
impossible("shk without eshk (%s)", msg);
|
impossible("shk without eshk (%s)", msg);
|
||||||
@@ -139,6 +138,14 @@ sanity_check_single_mon(
|
|||||||
} else if (!t_at(mx, my))
|
} else if (!t_at(mx, my))
|
||||||
impossible("trapped without a trap (%s)", msg);
|
impossible("trapped without a trap (%s)", msg);
|
||||||
}
|
}
|
||||||
|
/* monst->mfrozen is difficult to deal with--it's used for paralysis,
|
||||||
|
for temporary sleep, and for being busy (usually donning armor);
|
||||||
|
code that sets mfrozen needs to also clear mcanmove, otherwise the
|
||||||
|
helpless() test will be unreliable */
|
||||||
|
if (mtmp->mfrozen && mtmp->mcanmove)
|
||||||
|
impossible("frozen monster [%s%s] is able to move (%s)",
|
||||||
|
mtmp->mtame ? "tame " : mtmp->mpeaceful ? "peaceful " : "",
|
||||||
|
pmname(mptr, Mgender(mtmp)), msg);
|
||||||
|
|
||||||
/* monster is hiding? */
|
/* monster is hiding? */
|
||||||
if (mtmp->mundetected) {
|
if (mtmp->mundetected) {
|
||||||
@@ -270,7 +277,8 @@ mon_sanity_check(void)
|
|||||||
sanity_check_single_mon(mtmp, FALSE, "migr");
|
sanity_check_single_mon(mtmp, FALSE, "migr");
|
||||||
|
|
||||||
if ((mtmp->mstate
|
if ((mtmp->mstate
|
||||||
& ~(MON_MIGRATING | MON_LIMBO | MON_ENDGAME_MIGR | MON_OFFMAP)) != 0L
|
& ~(MON_MIGRATING | MON_LIMBO | MON_ENDGAME_MIGR | MON_OFFMAP))
|
||||||
|
!= 0L
|
||||||
|| !(mtmp->mstate & MON_MIGRATING))
|
|| !(mtmp->mstate & MON_MIGRATING))
|
||||||
impossible("migrating mon (%s) with mstate set to 0x%08lx",
|
impossible("migrating mon (%s) with mstate set to 0x%08lx",
|
||||||
fmt_ptr((genericptr_t) mtmp), mtmp->mstate);
|
fmt_ptr((genericptr_t) mtmp), mtmp->mstate);
|
||||||
|
|||||||
Reference in New Issue
Block a user