TTY: Guard against impossible x coord

If a menu item was longer than terminal width, the menu wasn't
cleared away after it was finished with.  This easily happened
when an inventory item was named.
This commit is contained in:
Pasi Kallinen
2015-03-27 15:29:54 +02:00
parent 08654c213c
commit 911a3756c6

View File

@@ -1809,6 +1809,7 @@ tty_display_nhwindow(window, blocking)
cw->offx = (uchar) (int)
max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1));
#endif
if(cw->offx < 0) cw->offx = 0;
if(cw->type == NHW_MENU)
cw->offy = 0;
if(ttyDisplay->toplin == 1)