From 73fbca5629cfed41838cfed59aa86dc7851b694b Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 19:56:48 +0100 Subject: [PATCH] Refactor handling of escape input a little - Includes port of KartKrew/Kart-Public!250 --- src/d_clisrv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index bcb6d073e..f345d6275 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1974,13 +1974,17 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { D_ProcessEvents(); //needed for menu system to receive inputs } - else + else if (netgame) { for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1)) G_MapEventsToControls(&events[eventtail]); + + if (gamekeydown[KEY_ESCAPE] + || gamekeydown[KEY_JOY1+1]) + cl_mode = CL_ABORTED; } - if ((gamekeydown[KEY_ESCAPE] || gamekeydown[KEY_JOY1+1]) || cl_mode == CL_ABORTED) + if (cl_mode == CL_ABORTED) { CONS_Printf(M_GetText("Network game synchronization aborted.\n")); // M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress ESC\n"), NULL, MM_NOTHING);