From 32b166669e6028839f34b97fbbf3b0240d98f4be Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 17 May 2022 19:57:31 -0500 Subject: [PATCH] Don't interpolate during net lag --- src/d_clisrv.c | 16 ++++++++++++++++ src/d_clisrv.h | 3 +++ src/d_main.c | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 3068f2314..4cd6333c5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -114,6 +114,9 @@ static INT16 consistancy[BACKUPTICS]; static UINT8 player_joining = false; UINT8 hu_redownloadinggamestate = 0; +// true when a player is connecting or disconnecting so that the gameplay has stopped in its tracks +boolean hu_stopped = false; + UINT8 adminpassmd5[16]; boolean adminpasswordset = false; @@ -5259,8 +5262,16 @@ boolean TryRunTics(tic_t realtics) ticking = neededtic > gametic; + if (ticking) + { + if (realtics) + hu_stopped = false; + } + if (player_joining) { + if (realtics) + hu_stopped = true; return false; } @@ -5300,6 +5311,11 @@ boolean TryRunTics(tic_t realtics) break; } } + else + { + if (realtics) + hu_stopped = true; + } return ticking; } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index c75f7f0bf..e07864122 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -458,4 +458,7 @@ extern UINT8 hu_redownloadinggamestate; extern UINT8 adminpassmd5[16]; extern boolean adminpasswordset; + +extern boolean hu_stopped; + #endif diff --git a/src/d_main.c b/src/d_main.c index 3786efd07..0ae48c927 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -853,7 +853,7 @@ void D_SRB2Loop(void) renderdeltatics = FLOAT_TO_FIXED(deltatics); - if (!(paused || P_AutoPause())) + if (!(paused || P_AutoPause()) && !hu_stopped) { rendertimefrac = g_time.timefrac; }