diff --git a/r5dev/engine/client/clientstate.cpp b/r5dev/engine/client/clientstate.cpp index 9c7643a9..d7ea44e1 100644 --- a/r5dev/engine/client/clientstate.cpp +++ b/r5dev/engine/client/clientstate.cpp @@ -12,6 +12,7 @@ #include "engine/host.h" #include "clientstate.h" #include "cdll_engine_int.h" +#include "vgui/vgui_baseui_interface.h" //------------------------------------------------------------------------------ @@ -19,7 +20,7 @@ //------------------------------------------------------------------------------ bool CClientState::IsPaused() const { - return m_bPaused; + return m_bPaused || !*host_initialized || g_pEngineVGui->ShouldPause(); } //------------------------------------------------------------------------------ @@ -102,6 +103,19 @@ void CClientState::SetClientTickCount(int tick) m_ClockDriftMgr.m_nClientTick = tick; } +//------------------------------------------------------------------------------ +// Purpose: gets the client frame time +//------------------------------------------------------------------------------ +float CClientState::GetFrameTime() const +{ + if (IsPaused()) + { + return 0.0f; + } + + return m_flFrameTime; +} + //------------------------------------------------------------------------------ // Purpose: //------------------------------------------------------------------------------ diff --git a/r5dev/engine/client/clientstate.h b/r5dev/engine/client/clientstate.h index 66152440..6ea000cf 100644 --- a/r5dev/engine/client/clientstate.h +++ b/r5dev/engine/client/clientstate.h @@ -42,6 +42,8 @@ public: int GetClientTickCount() const; // Get the client tick count. void SetClientTickCount(int tick); + float GetFrameTime(void) const; + int m_Socket; int _padding_maybe; CNetChan* m_NetChannel; @@ -113,9 +115,9 @@ public: char error_message[512]; _BYTE gap18CA1[3]; _DWORD last_usercmd_time_from_server_maybe; - CFrameSnapshot* prev_frame_maybe; + CFrameSnapshot* m_PrevFrameSnapshot; _QWORD qword18CB0; - CFrameSnapshot* current_frame_maybe; + CFrameSnapshot* m_CurrFrameSnapshot; _BYTE gap18CC0[8]; char m_bClockCorrectionEnabled; char m_b_unknown;