[nq] Add more checks for dedicated server in client

When the nq client is run in dedicated server mode, the client state is not
initialized thus none of the client code should be run. This became more
critical with the addition of scenes and an ECS as there are a lot more
pointers involved.

Fixes #46
This commit is contained in:
Bill Currie 2023-11-19 15:03:13 +09:00
parent 49667b439d
commit e8b2822587
2 changed files with 6 additions and 1 deletions

View file

@ -328,6 +328,9 @@ CL_StopCshifts (void)
void
CL_Disconnect (void)
{
if (net_is_dedicated) {
return;
}
// stop sounds (especially looping!)
S_StopAllSounds ();

View file

@ -298,7 +298,9 @@ Host_Map_f (void)
cl.viewstate.loading = true;
cl.viewstate.time = cl.time;
cl.viewstate.realtime = realtime;
CL_UpdateScreen (&cl.viewstate);
if (!net_is_dedicated) {
CL_UpdateScreen (&cl.viewstate);
}
svs.serverflags = 0; // haven't completed an episode yet
strcpy (name, Cmd_Argv (1));