ensure tty_curs() behaves the same whether DEBUG defined or not
ensure tty_curs() behaves the same whether DEBUG defined or not when it comes to positioning the cursor. The return statement, in the debug case only, was preventing the cursor from being moved following a range check, so the next output was written whereever the cursor happened to be previously. The messaging that detects the failed range check will get written in the DEBUG defined case hopefully allowing resolution to the range check failure, but now the cmov will still be attempted just as it is in the case where DEBUG is not defined.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wintty.c $NHDT-Date: 1506908980 2017/10/02 01:49:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.140 $ */
|
||||
/* NetHack 3.6 wintty.c $NHDT-Date: 1520825319 2018/03/12 03:28:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.142 $ */
|
||||
/* Copyright (c) David Cohrs, 1991 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2365,7 +2365,13 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and
|
||||
}
|
||||
debugpline4("bad curs positioning win %d %s (%d,%d)", window, s, x,
|
||||
y);
|
||||
return;
|
||||
/* This return statement caused a functional difference between DEBUG and
|
||||
non-DEBUG operation, so it is being commented out. It caused tty_curs()
|
||||
to fail to move the cursor to the location it needed to be if the x,y
|
||||
range checks failed, leaving the next piece of output to be displayed
|
||||
at whatever random location the cursor happened to be at prior. */
|
||||
|
||||
/* return; */
|
||||
}
|
||||
#endif
|
||||
x += cw->offx;
|
||||
|
||||
Reference in New Issue
Block a user