Fix: a number of unblock_points shouldn't unblock unconditionally
Initially diagnosed in an xnethack fuzzer crash - unblock_point shouldn't be called when a closed door becomes non-closed, because it's possible that there's a gas cloud on the space which means it still blocks vision. These always need to be recalc_block_point. A number of them were fixed, but when I went through all the xnethack ones, I found some that were unchanged from upstream NetHack. I reproduced the sanity check impossibles usually by breathing gas at a door as an iron golem and then opening or destroying the door to trigger the unblock_point call. The use of recalc_block_point in wizterrainwish was not triggering this bug, but the previous code there basically duplicated recalc_block_point.
This commit is contained in:
@@ -1435,7 +1435,7 @@ mdig_tunnel(struct monst *mtmp)
|
||||
sawit = canseemon(mtmp); /* before door state change and unblock_pt */
|
||||
trapped = (here->doormask & D_TRAPPED) ? TRUE : FALSE;
|
||||
here->doormask = trapped ? D_NODOOR : D_BROKEN;
|
||||
unblock_point(mtmp->mx, mtmp->my); /* vision */
|
||||
recalc_block_point(mtmp->mx, mtmp->my); /* vision */
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
if (trapped) {
|
||||
seeit = canseemon(mtmp);
|
||||
|
||||
Reference in New Issue
Block a user