From bf580a71342987d5d9fe05a8547ff6d31fba53fc Mon Sep 17 00:00:00 2001 From: BotoX Date: Mon, 2 Sep 2019 23:15:08 +0200 Subject: [PATCH] reorder function calls --- extensions/cstrike/timeleft.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/cstrike/timeleft.cpp b/extensions/cstrike/timeleft.cpp index 2cf7ee08..ab7633f2 100644 --- a/extensions/cstrike/timeleft.cpp +++ b/extensions/cstrike/timeleft.cpp @@ -60,12 +60,14 @@ void TimeLeftEvents::FireGameEvent(IGameEvent *event) get_new_timeleft_offset = false; float flGameStartTime = gpGlobals->curtime; - sm_sendprop_info_t info; - if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info)) + uintptr_t gamerules = (uintptr_t)g_pSDKTools->GetGameRules(); + if (gamerules) { - uintptr_t gamerules = (uintptr_t)g_pSDKTools->GetGameRules(); - if (gamerules) + sm_sendprop_info_t info; + if (gamehelpers->FindSendPropInfo("CCSGameRulesProxy", "m_flGameStartTime", &info)) + { flGameStartTime = *(float *)(gamerules + info.actual_offset); + } } timersys->NotifyOfGameStart(flGameStartTime - gpGlobals->curtime);