[Node] Use clcState instead of CL_IsCgameInitialized

Game::CL_IsCgameInitialized() only returns true when the player is actually in the game. With this clcState returns 0 when in main menu so if clcState isn't 0 we will return.
This commit is contained in:
Joelrau 2020-12-04 23:20:15 +02:00
parent ebe27166f8
commit eb897f9a76

View File

@ -169,7 +169,7 @@ namespace Components
{
if (Dedicated::IsEnabled() && Dvar::Var("sv_lanOnly").get<bool>()) return;
if (!Dedicated::IsEnabled() && Game::CL_IsCgameInitialized())
if (!Dedicated::IsEnabled() && *Game::clcState > 0)
{
wasIngame = true;
return; // don't run while ingame because it can still cause lag spikes on lower end PCs