From 810bad9fd8cf344f7d73b82f042910a4c443b0f7 Mon Sep 17 00:00:00 2001 From: erorcun Date: Fri, 29 Jan 2021 01:44:33 +0300 Subject: Fix some UBs --- src/core/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/core/main.cpp') diff --git a/src/core/main.cpp b/src/core/main.cpp index 9a0308dd..a08a9535 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1065,8 +1065,13 @@ DisplayGameDebugText() #endif FrameSamples++; +#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND + FramesPerSecondCounter += frameTime / 1000.f; // convert to seconds + FramesPerSecond = FrameSamples / FramesPerSecondCounter; +#else FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f); FramesPerSecond = FramesPerSecondCounter / FrameSamples; +#endif if ( FrameSamples > 30 ) { -- cgit v1.2.3