]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
pk3 csprogs: fix logic error when switching to csprogs that aren't in any pk3
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 15 Jan 2016 05:21:52 +0000 (16:21 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 15 Jan 2016 05:23:01 +0000 (16:23 +1100)
qcsrc/server/g_world.qc

index 7f831d252cd751a9add99c3b43eecf09748c713a..160be73891f73cac4aefa42b0a1baadbdc8aa3bc 100644 (file)
@@ -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;