Trap sanity checking
This commit is contained in:
@@ -3419,6 +3419,7 @@ sanity_check(void)
|
||||
mon_sanity_check();
|
||||
light_sources_sanity_check();
|
||||
bc_sanity_check();
|
||||
trap_sanity_check();
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MIGRATING_MONS
|
||||
|
||||
16
src/trap.c
16
src/trap.c
@@ -6125,4 +6125,20 @@ trap_ice_effects(xchar x, xchar y, boolean ice_is_melting)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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*/
|
||||
|
||||
Reference in New Issue
Block a user