aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/dedicated/dedicated.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2023-02-12 21:15:00 +0000
committerGitHub <noreply@github.com>2023-02-12 21:15:00 +0000
commit95b41b6f8cc612953eafd7f8b6b40124e1590bc7 (patch)
tree400746bace6855c210e020a5ca93b84c2fdd0dc9 /NorthstarDLL/dedicated/dedicated.cpp
parentb61ed18a86ddd2d7ab0e80992859750a49a9c4f6 (diff)
downloadNorthstarLauncher-95b41b6f8cc612953eafd7f8b6b40124e1590bc7.tar.gz
NorthstarLauncher-95b41b6f8cc612953eafd7f8b6b40124e1590bc7.zip
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
Diffstat (limited to 'NorthstarDLL/dedicated/dedicated.cpp')
-rw-r--r--NorthstarDLL/dedicated/dedicated.cpp7
1 files changed, 2 insertions, 5 deletions
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<double, std::ratio<1>>(
- Cvar_base_tickinterval_mp->GetFloat() - fmin(Tier0::Plat_FloatTime() - frameStart, 0.25)));
+ std::this_thread::sleep_for(
+ std::chrono::duration<double, std::ratio<1>>(g_pGlobals->m_flTickInterval - fmin(Tier0::Plat_FloatTime() - frameStart, 0.25)));
}
}