From: TimePath Date: Fri, 15 Jan 2016 05:21:52 +0000 (+1100) Subject: pk3 csprogs: fix logic error when switching to csprogs that aren't in any pk3 X-Git-Tag: xonotic-v0.8.2~1245 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ed7487e70dc337a8043313814a783fd4cfc8bc9;p=xonotic%2Fxonotic-data.pk3dir.git pk3 csprogs: fix logic error when switching to csprogs that aren't in any pk3 --- diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 7f831d252..160be7389 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -583,9 +583,12 @@ spawnfunc(worldspawn) // Only ever use versioned csprogs.dat files on dedicated servers; // we need to reset csqc_progname on clients ourselves, and it's easier if the client's release name is constant string pk3csprogs = "csprogs-" WATERMARK ".dat"; - if (cvar_string_normal("csqc_progname") != pk3csprogs && fexists(pk3csprogs)) + // This always works; fall back to it if a versioned csprogs.dat is suddenly missing + string select = "csprogs.dat"; + if (fexists(pk3csprogs)) select = pk3csprogs; + if (cvar_string_normal("csqc_progname") != select) { - cvar_set_normal("csqc_progname", pk3csprogs); + cvar_set_normal("csqc_progname", select); wantrestart = true; } // Check for updates on startup @@ -616,8 +619,12 @@ spawnfunc(worldspawn) } } } - if (wantrestart) changelevel(mapname); - // let initialization continue, shutdown depends on it + if (wantrestart) + { + LOG_INFOF("Restart requested\n"); + changelevel(mapname); + // let initialization continue, shutdown depends on it + } } float fd, l;