extern const char * trapname(int, boolean);
extern void ignite_items(struct obj *);
extern void trap_ice_effects(xchar x, xchar y, boolean ice_is_melting);
+extern void trap_sanity_check(void);
/* ### u_init.c ### */
mon_sanity_check();
light_sources_sanity_check();
bc_sanity_check();
+ trap_sanity_check();
}
#ifdef DEBUG_MIGRATING_MONS
}
}
}
+
+/* sanity check traps */
+void
+trap_sanity_check(void)
+{
+ struct trap *ttmp = g.ftrap;
+
+ while (ttmp) {
+ if (!isok(ttmp->tx, ttmp->ty))
+ impossible("trap sanity: location");
+ if (ttmp->ttyp < 0 || ttmp->ttyp >= TRAPNUM)
+ impossible("trap sanity: type");
+ ttmp = ttmp->ntrap;
+ }
+}
+
/*trap.c*/