From 1d64635783259e3b3699b542012b0c71e8c27d2b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 11 Oct 2024 00:04:03 +0300 Subject: [PATCH] engine: correctly check for cls.legacymode, as it's not a boolean anymore --- engine/client/cl_frame.c | 4 ++-- engine/client/cl_main.c | 2 +- engine/common/host.c | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/engine/client/cl_frame.c b/engine/client/cl_frame.c index 515c0960..1d6368d6 100644 --- a/engine/client/cl_frame.c +++ b/engine/client/cl_frame.c @@ -174,7 +174,7 @@ static qboolean CL_EntityCustomLerp( cl_entity_t *e ) // INTERPOLATION IN GRAVGUNMOD COOP // MUST BE REMOVED ONCE WE REMOVE 48 PROTO SUPPORT case MOVETYPE_TOSS: - if( cls.legacymode && e->model && e->model->type == mod_studio ) + if( cls.legacymode == PROTO_LEGACY && e->model && e->model->type == mod_studio ) return false; } @@ -1265,7 +1265,7 @@ static void CL_LinkPacketEntities( frame_t *frame ) // ABSOLUTELY STUPID HACK TO ALLOW MONSTERS // INTERPOLATION IN GRAVGUNMOD COOP // MUST BE REMOVED ONCE WE REMOVE 48 PROTO SUPPORT - else if( cls.legacymode && ent->model->type == mod_studio && ent->curstate.movetype == MOVETYPE_TOSS ) + else if( cls.legacymode == PROTO_LEGACY && ent->model->type == mod_studio && ent->curstate.movetype == MOVETYPE_TOSS ) { if( !CL_InterpolateModel( ent )) continue; diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 600dad51..b0db4e20 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -1215,7 +1215,7 @@ static void CL_CheckForResend( void ) else if( cl_resend.value > CL_MAX_RESEND_TIME ) Cvar_SetValue( "cl_resend", CL_MAX_RESEND_TIME ); - bandwidthTest = !cls.legacymode && cl_test_bandwidth.value && cls.connect_retry <= CL_TEST_RETRIES; + bandwidthTest = cls.legacymode == PROTO_CURRENT && cl_test_bandwidth.value && cls.connect_retry <= CL_TEST_RETRIES; resendTime = bandwidthTest ? 1.0f : cl_resend.value; if(( host.realtime - cls.connect_time ) < resendTime ) diff --git a/engine/common/host.c b/engine/common/host.c index 6148582d..95e173a1 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -246,8 +246,20 @@ void Host_ValidateEngineFeatures( uint32_t features ) uint32_t mask = ENGINE_FEATURES_MASK; #if !XASH_DEDICATED - if( !Host_IsDedicated( ) && cls.legacymode ) - mask = ENGINE_LEGACY_FEATURES_MASK; + if( !Host_IsDedicated( )) + { + switch( cls.legacymode ) + { + case PROTO_CURRENT: + break; + case PROTO_LEGACY: + mask = ENGINE_LEGACY_FEATURES_MASK; + break; + default: + mask = 0; + break; + } + } #endif // don't allow unsupported bits