Trap sanity checking
This commit is contained in:
@@ -2736,6 +2736,7 @@ extern void sokoban_guilt(void);
|
|||||||
extern const char * trapname(int, boolean);
|
extern const char * trapname(int, boolean);
|
||||||
extern void ignite_items(struct obj *);
|
extern void ignite_items(struct obj *);
|
||||||
extern void trap_ice_effects(xchar x, xchar y, boolean ice_is_melting);
|
extern void trap_ice_effects(xchar x, xchar y, boolean ice_is_melting);
|
||||||
|
extern void trap_sanity_check(void);
|
||||||
|
|
||||||
/* ### u_init.c ### */
|
/* ### u_init.c ### */
|
||||||
|
|
||||||
|
|||||||
@@ -3419,6 +3419,7 @@ sanity_check(void)
|
|||||||
mon_sanity_check();
|
mon_sanity_check();
|
||||||
light_sources_sanity_check();
|
light_sources_sanity_check();
|
||||||
bc_sanity_check();
|
bc_sanity_check();
|
||||||
|
trap_sanity_check();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_MIGRATING_MONS
|
#ifdef DEBUG_MIGRATING_MONS
|
||||||
|
|||||||
+16
@@ -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*/
|
/*trap.c*/
|
||||||
|
|||||||
Reference in New Issue
Block a user