From 902b6611fdc7b78b0983dd98c8e4467c6c4b686e Mon Sep 17 00:00:00 2001 From: LordSk Date: Fri, 16 Nov 2018 18:52:15 +0100 Subject: [PATCH] Reverted time_get use, fixed m_LocalStartTime being reset --- src/engine/client/client.cpp | 1 - src/game/client/components/menus.cpp | 4 ++-- src/game/client/components/menus.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 62b48cdd0..e41c2af27 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1373,7 +1373,6 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket) m_GameTime.Init((GameTick-1)*time_freq()/50); m_aSnapshots[SNAP_PREV] = m_SnapshotStorage.m_pFirst; m_aSnapshots[SNAP_CURRENT] = m_SnapshotStorage.m_pLast; - m_LocalStartTime = time_get(); SetState(IClient::STATE_ONLINE); DemoRecorder_HandleAutoStart(); } diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index b84e1bd1e..4c1c36b4b 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -84,11 +84,11 @@ float CMenus::ButtonFade(CButtonContainer *pBC, float Seconds, int Checked) { if(UI()->HotItem() == pBC->GetID() || Checked) { - pBC->m_FadeStartTime = time_get(); + pBC->m_FadeStartTime = Client()->LocalTime(); return Seconds; } - return max(0.0f, (pBC->m_FadeStartTime - time_get()) / (float)time_freq() + Seconds); + return max(0.0f, pBC->m_FadeStartTime - Client()->LocalTime() + Seconds); } int CMenus::DoIcon(int ImageId, int SpriteId, const CUIRect *pRect) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index a738b147b..83aac1938 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -35,7 +35,7 @@ public: class CButtonContainer { public: - int64 m_FadeStartTime; + float m_FadeStartTime; const void *GetID() const { return &m_FadeStartTime; } };