add pet->droptime check to monster sanity check
I don't see where loading or saving bones makes any attempt to fix up pet->droptime at all.
This commit is contained in:
37
src/mon.c
37
src/mon.c
@@ -6,6 +6,7 @@
|
|||||||
#include "hack.h"
|
#include "hack.h"
|
||||||
#include "mfndpos.h"
|
#include "mfndpos.h"
|
||||||
|
|
||||||
|
staticfn void pet_sanity_check(struct monst *, const char *);
|
||||||
staticfn void sanity_check_single_mon(struct monst *, boolean, const char *);
|
staticfn void sanity_check_single_mon(struct monst *, boolean, const char *);
|
||||||
staticfn struct obj *make_corpse(struct monst *, unsigned);
|
staticfn struct obj *make_corpse(struct monst *, unsigned);
|
||||||
staticfn int minliquid_core(struct monst *);
|
staticfn int minliquid_core(struct monst *);
|
||||||
@@ -45,14 +46,28 @@ extern const struct shclass shtypes[]; /* defined in shknam.c */
|
|||||||
|| !svl.level.flags.deathdrops \
|
|| !svl.level.flags.deathdrops \
|
||||||
|| (svl.level.flags.graveyard && is_undead(mdat) && rn2(3)))
|
|| (svl.level.flags.graveyard && is_undead(mdat) && rn2(3)))
|
||||||
|
|
||||||
|
#if 0 /* potentially of historical interest */
|
||||||
#if 0
|
|
||||||
/* part of the original warning code which was replaced in 3.3.1 */
|
/* part of the original warning code which was replaced in 3.3.1 */
|
||||||
const char *warnings[] = {
|
const char *warnings[] = {
|
||||||
"white", "pink", "red", "ruby", "purple", "black"
|
"white", "pink", "red", "ruby", "purple", "black"
|
||||||
};
|
};
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
|
staticfn void
|
||||||
|
pet_sanity_check(
|
||||||
|
struct monst *mtmp,
|
||||||
|
const char *msgarg)
|
||||||
|
{
|
||||||
|
if (has_edog(mtmp)) {
|
||||||
|
struct edog *edog = EDOG(mtmp);
|
||||||
|
|
||||||
|
if (edog->droptime > svm.moves)
|
||||||
|
impossible("insane pet #%u has droptime (%ld)"
|
||||||
|
" in the future (%ld) (%s)",
|
||||||
|
mtmp->m_id, edog->droptime, svm.moves, msgarg);
|
||||||
|
/* TODO: verify some of the other edog fields */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
staticfn void
|
staticfn void
|
||||||
sanity_check_single_mon(
|
sanity_check_single_mon(
|
||||||
@@ -116,8 +131,12 @@ sanity_check_single_mon(
|
|||||||
if (mtmp->isminion && !has_emin(mtmp))
|
if (mtmp->isminion && !has_emin(mtmp))
|
||||||
impossible("minion without emin (%s)", msg);
|
impossible("minion without emin (%s)", msg);
|
||||||
/* guardian angel on astral level is tame but has emin rather than edog */
|
/* guardian angel on astral level is tame but has emin rather than edog */
|
||||||
if (mtmp->mtame && !has_edog(mtmp) && !mtmp->isminion)
|
if (mtmp->mtame) {
|
||||||
impossible("pet without edog (%s)", msg);
|
if (!has_edog(mtmp) && !mtmp->isminion)
|
||||||
|
impossible("pet without edog (%s)", msg);
|
||||||
|
else
|
||||||
|
pet_sanity_check(mtmp, msg);
|
||||||
|
}
|
||||||
/* steed should be tame and saddled */
|
/* steed should be tame and saddled */
|
||||||
if (mtmp == u.usteed) {
|
if (mtmp == u.usteed) {
|
||||||
const char *ns, *nt = !mtmp->mtame ? "not tame" : 0;
|
const char *ns, *nt = !mtmp->mtame ? "not tame" : 0;
|
||||||
@@ -133,7 +152,7 @@ sanity_check_single_mon(
|
|||||||
|
|
||||||
if (mtmp->mtrapped) {
|
if (mtmp->mtrapped) {
|
||||||
if (mtmp->wormno) {
|
if (mtmp->wormno) {
|
||||||
/* TODO: how to check worm in trap? */
|
; /* TODO: how to check worm in trap? */
|
||||||
} 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);
|
||||||
}
|
}
|
||||||
@@ -6056,4 +6075,12 @@ flash_mon(struct monst *mtmp)
|
|||||||
gv.viz_array[my][mx] = saveviz;
|
gv.viz_array[my][mx] = saveviz;
|
||||||
newsym(mx, my);
|
newsym(mx, my);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* cleanup for 'onefile' processing */
|
||||||
|
#undef LEVEL_SPECIFIC_NOCORPSE
|
||||||
|
#undef KEEPTRAITS
|
||||||
|
#undef mstoning
|
||||||
|
#undef livelog_mon_nam
|
||||||
|
#undef BREEDER_EGG
|
||||||
|
|
||||||
/*mon.c*/
|
/*mon.c*/
|
||||||
|
|||||||
Reference in New Issue
Block a user