mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Use server current time for reload logic
Use server's current time for reload logic instead of a dedicated fast timer.
This commit is contained in:
parent
612ab83b20
commit
15e9259b77
@ -230,7 +230,6 @@ FORCEINLINE void CHostState::Think(void) const
|
||||
static bool bInitialized = false;
|
||||
static CFastTimer banListTimer;
|
||||
static CFastTimer pylonTimer;
|
||||
static CFastTimer reloadTimer;
|
||||
static CFastTimer statsTimer;
|
||||
|
||||
if (!bInitialized) // Initialize clocks.
|
||||
@ -241,7 +240,6 @@ FORCEINLINE void CHostState::Think(void) const
|
||||
pylonTimer.Start();
|
||||
#endif // DEDICATED
|
||||
statsTimer.Start();
|
||||
reloadTimer.Start();
|
||||
#endif // !CLIENT_DLL
|
||||
bInitialized = true;
|
||||
}
|
||||
@ -281,10 +279,9 @@ FORCEINLINE void CHostState::Think(void) const
|
||||
#ifndef CLIENT_DLL
|
||||
if (sv_autoReloadRate->GetBool())
|
||||
{
|
||||
if (reloadTimer.GetDurationInProgress().GetSeconds() > sv_autoReloadRate->GetDouble())
|
||||
if (g_ServerGlobalVariables->m_flCurTime > sv_autoReloadRate->GetDouble())
|
||||
{
|
||||
Cbuf_AddText(Cbuf_GetCurrentPlayer(), "reload\n", cmd_source_t::kCommandSrcCode);
|
||||
reloadTimer.Start();
|
||||
}
|
||||
}
|
||||
if (statsTimer.GetDurationInProgress().GetSeconds() > sv_statusRefreshRate->GetDouble())
|
||||
|
Loading…
x
Reference in New Issue
Block a user