Engine: Keep HTTP from endlessly formatting NaN values

For whatever reason, our progress count for HTTP downloads stays at 0.
This results in the engine calculating a NaN progress value many times
each frame, which results in a significant performance hit.
This commit is contained in:
Tim Schumacher 2022-05-02 01:22:35 +02:00 committed by Alibek Omarov
parent afaabe26a6
commit a1ce5faac2

View File

@ -2280,7 +2280,7 @@ void HTTP_Run( void )
}
// update progress
if( !Host_IsDedicated() )
if( !Host_IsDedicated() && iProgressCount != 0 )
Cvar_SetValue( "scr_download", flProgress/iProgressCount * 100 );
HTTP_AutoClean();