tty: fix 'statuslines' off by 1 error

With CLIPPING disabled you should need a terminal or window with at
least 25 lines to change the 'statuslines' option from 2 to 3, but
it was being allowed on tty when there were only 24 lines available.

I think the other interfaces always have clipping capability enabled
so aren't affected.

Not many level maps extend to the bottom row (line 22 for a 1-based
count) so it wasn't likely to be noticed during play.  That points
that maps which don't use all rows and/or all columns could get by
without clipping by adjusting their position.  However, implementing
adaptive clipping is not something that I'm going to try to tackle.
This commit is contained in:
PatR
2023-11-19 01:11:43 -08:00
parent 3021423a5f
commit f23176155c

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 wintty.c $NHDT-Date: 1698017917 2023/10/22 23:38:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.354 $ */
/* NetHack 3.7 wintty.c $NHDT-Date: 1700385095 2023/11/19 09:11:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.365 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -595,9 +595,9 @@ tty_init_nhwindows(int *argcp UNUSED, char **argv UNUSED)
if ((tty_procs.wincap2 & WC2_STATUSLINES) != 0)
set_wc2_option_mod_status(WC2_STATUSLINES,
#ifndef CLIPPING
(LI < 1 + ROWNO + 2) ? set_gameview :
(LI <= 1 + ROWNO + 2) ? set_gameview :
#endif
set_in_game);
set_in_game);
}
void