Add vision sanity checking, fix more vision
- Add a vision sanity checking routine - Recalc block point when digging a door for temporary clouds - Add recalc_block_point after cvt_sdoor_to_door, because doorways on the Rogue level have no doors, and otherwise the sanity checking would complain. This doesn't actually change how the Rogue level vision works, as it uses a different vision system - Monster using a trap in a secret corridor revealed the corridor, but didn't unblock the vision unless you saw the location
This commit is contained in:
@@ -20,6 +20,7 @@ staticfn void mon_chain(winid, const char *, struct monst *, boolean, long *,
|
||||
staticfn void contained_stats(winid, const char *, long *, long *);
|
||||
staticfn void misc_stats(winid, long *, long *);
|
||||
staticfn void you_sanity_check(void);
|
||||
staticfn void levl_sanity_check(void);
|
||||
staticfn void makemap_unmakemon(struct monst *, boolean);
|
||||
staticfn int QSORTCALLBACK migrsort_cmp(const genericptr, const genericptr);
|
||||
staticfn void list_migrating_mons(d_level *);
|
||||
@@ -1437,6 +1438,22 @@ you_sanity_check(void)
|
||||
(void) check_invent_gold("invent");
|
||||
}
|
||||
|
||||
staticfn void
|
||||
levl_sanity_check(void)
|
||||
{
|
||||
coordxy x, y;
|
||||
|
||||
if (Underwater)
|
||||
return; /* Underwater uses different vision */
|
||||
|
||||
for (y = 0; y < ROWNO; y++) {
|
||||
for (x = 1; x < COLNO; x++) {
|
||||
if ((does_block(x, y, &levl[x][y]) ? 1 : 0) != get_viz_clear(x, y))
|
||||
impossible("levl[%i][%i] vision blocking", x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
sanity_check(void)
|
||||
{
|
||||
@@ -1457,6 +1474,7 @@ sanity_check(void)
|
||||
bc_sanity_check();
|
||||
trap_sanity_check();
|
||||
engraving_sanity_check();
|
||||
levl_sanity_check();
|
||||
program_state.in_sanity_check--;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user