From b8029e04f56cafebf19a6809212c14d8c293158c Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Wed, 11 May 2022 00:07:47 +0300 Subject: [PATCH] Fix off-by-one in video menu mouse move cursor update --- Quake/gl_vidsdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index b5ce3cd6d..37f750b07 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -2329,7 +2329,7 @@ static void VID_MenuMouse (int cx, int cy) --cursor; // past the gap, correct the index else if (cursor == VID_OPT_TEST) return; // inside the gap, do nothing - cursor = CLAMP (0, cursor, VIDEO_OPTIONS_ITEMS); + cursor = CLAMP (0, cursor, VIDEO_OPTIONS_ITEMS - 1); video_options_cursor = cursor; }