From 95b41b6f8cc612953eafd7f8b6b40124e1590bc7 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sun, 12 Feb 2023 21:15:00 +0000 Subject: Add `CGlobals` class and `g_pGlobals`, and update code to support (#411) * add CGlobals class and g_pGlobals, and update scripts to support * don't automatically enable antispeedhack (oops) * add dedicated.cpp * format * bad push oops * reformat again --- NorthstarDLL/dedicated/dedicated.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'NorthstarDLL/dedicated/dedicated.cpp') diff --git a/NorthstarDLL/dedicated/dedicated.cpp b/NorthstarDLL/dedicated/dedicated.cpp index 3d7d756c..e58900b7 100644 --- a/NorthstarDLL/dedicated/dedicated.cpp +++ b/NorthstarDLL/dedicated/dedicated.cpp @@ -57,9 +57,6 @@ void RunServer(CDedicatedExports* dedicated) Cbuf_AddText(Cbuf_GetCurrentPlayer(), "stuffcmds", cmd_source_t::kCommandSrcCode); Cbuf_Execute(); - // get tickinterval - ConVar* Cvar_base_tickinterval_mp = g_pCVar->FindVar("base_tickinterval_mp"); - // main loop double frameTitle = 0; while (g_pEngine->m_nQuitting == EngineQuitState::QUIT_NOTQUITTING) @@ -67,8 +64,8 @@ void RunServer(CDedicatedExports* dedicated) double frameStart = Tier0::Plat_FloatTime(); g_pEngine->Frame(); - std::this_thread::sleep_for(std::chrono::duration>( - Cvar_base_tickinterval_mp->GetFloat() - fmin(Tier0::Plat_FloatTime() - frameStart, 0.25))); + std::this_thread::sleep_for( + std::chrono::duration>(g_pGlobals->m_flTickInterval - fmin(Tier0::Plat_FloatTime() - frameStart, 0.25))); } } -- cgit v1.2.3