From f23176155c0815512a9834df429674ac99460641 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 19 Nov 2023 01:11:43 -0800 Subject: [PATCH] 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. --- win/tty/wintty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index bb487541c..5d90a7798 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -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