engine: server: even if user set non-integer value for cl_updaterate, clamp it to sv_minupdaterate

This commit is contained in:
Alibek Omarov 2025-02-15 06:32:16 +03:00
parent 340a8b5e0c
commit c5d4af802c

View file

@ -1900,11 +1900,8 @@ static void SV_UserinfoChanged( sv_client_t *cl )
if( COM_CheckString( val )) if( COM_CheckString( val ))
{ {
if( Q_atoi( val ) != 0 ) float rate = Q_atoi( val );
{ cl->cl_updaterate = 1.0 / bound( sv_minupdaterate.value, rate, sv_maxupdaterate.value );
cl->cl_updaterate = 1.0 / bound( sv_minupdaterate.value, Q_atoi( val ), sv_maxupdaterate.value );
}
else cl->cl_updaterate = 0.0;
} }
// call prog code to allow overrides // call prog code to allow overrides