From e8b2822587bd9d2171a794645a1adae136199604 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 19 Nov 2023 15:03:13 +0900 Subject: [PATCH] [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 --- nq/source/cl_main.c | 3 +++ nq/source/host_cmd.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index f8f21c98b..86e654830 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -328,6 +328,9 @@ CL_StopCshifts (void) void CL_Disconnect (void) { + if (net_is_dedicated) { + return; + } // stop sounds (especially looping!) S_StopAllSounds (); diff --git a/nq/source/host_cmd.c b/nq/source/host_cmd.c index 07d56104e..68121c47a 100644 --- a/nq/source/host_cmd.c +++ b/nq/source/host_cmd.c @@ -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));