Add partial support for the cd loop parameter in legacy map's .cfg files, allows...
authorMario <mario@smbclan.net>
Sat, 10 Aug 2019 16:44:23 +0000 (02:44 +1000)
committerMario <mario@smbclan.net>
Sat, 10 Aug 2019 16:44:23 +0000 (02:44 +1000)
qcsrc/server/g_world.qc

index 79b7d97..8680b83 100644 (file)
@@ -860,8 +860,14 @@ spawnfunc(worldspawn)
                                        continue;
                                if(argv(0) == "cd")
                                {
                                        continue;
                                if(argv(0) == "cd")
                                {
+                                       string trackname = argv(2);
                                        LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:");
                                        LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:");
-                                       LOG_INFO("  cdtrack ", argv(2));
+                                       LOG_INFO("  cdtrack ", trackname);
+                                       if (cvar_value_issafe(trackname))
+                                       {
+                                               string newstuff = strcat(clientstuff, "cd loop \"", trackname, "\"\n");
+                                               strcpy(clientstuff, newstuff);
+                                       }
                                }
                                else if(argv(0) == "fog")
                                {
                                }
                                else if(argv(0) == "fog")
                                {