Merge pull request #263 from mjkzy/master-server

only return node frame on non-dedi instances with master server on
This commit is contained in:
Edo 2022-05-10 18:39:57 +01:00 committed by GitHub
commit df71586e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,13 +167,17 @@ namespace Components
void Node::RunFrame() void Node::RunFrame()
{ {
if (ServerList::useMasterServer) return;
if (Dedicated::IsEnabled() && Dedicated::SVLanOnly.get<bool>()) return; if (Dedicated::IsEnabled() && Dedicated::SVLanOnly.get<bool>()) return;
if (!Dedicated::IsEnabled() && *Game::clcState > 0) if (!Dedicated::IsEnabled())
{ {
wasIngame = true; if (ServerList::useMasterServer) return; // don't run node frame if master server is active
return; // don't run while ingame because it can still cause lag spikes on lower end PCs
if (*Game::clcState > 0)
{
wasIngame = true;
return; // don't run while ingame because it can still cause lag spikes on lower end PCs
}
} }
if (wasIngame) // our last frame we were ingame and now we aren't so touch all nodes if (wasIngame) // our last frame we were ingame and now we aren't so touch all nodes