Switch to the old (safer) instantaction system. With the only exception of allowing...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 28 Sep 2010 15:41:21 +0000 (18:41 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 28 Sep 2010 15:41:21 +0000 (18:41 +0300)
data/qcsrc/menu/voret/dialog_singleplayer.c

index 867b09c8913401e951f5be35a8f4599598dfce85..b95ffebe714d5ec7a3776b5e863e1c57fa0c7a6b 100644 (file)
@@ -26,8 +26,20 @@ void InstantAction_LoadMap(entity btn, entity dummy)
                return;\r
        while((s = fgets(fh)))\r
        {\r
+               if(substring(s, 0, 4) == "set ")\r
+                       s = substring(s, 4, strlen(s) - 4);\r
                n = tokenize_console(s);\r
-               if(argv(0) == "changelevel")\r
+               if(argv(0) == "bot_number")\r
+                       cvar_set("bot_number", argv(1));\r
+               else if(argv(0) == "skill")\r
+                       cvar_set("skill", argv(1));\r
+               else if(argv(0) == "timelimit")\r
+                       cvar_set("timelimit_override", argv(1));\r
+               else if(argv(0) == "fraglimit")\r
+                       cvar_set("fraglimit_override", argv(1));\r
+               else if(argv(0) == "gametype")\r
+                       MapInfo_SwitchGameType(MapInfo_Type_FromString(argv(1)));\r
+               else if(argv(0) == "changelevel")\r
                {\r
                        fclose(fh);\r
                        localcmd("\nmenu_loadmap_prepare\n");\r
@@ -35,10 +47,6 @@ void InstantAction_LoadMap(entity btn, entity dummy)
                        cvar_set("lastlevel", "1");\r
                        return;\r
                }\r
-               else if(argv(0) == "gametype")\r
-                       MapInfo_SwitchGameType(MapInfo_Type_FromString(argv(1)));\r
-               else if(argv(0) != "" && argv(0) != "//" && argv(0) != "#")\r
-                       cvar_set(argv(0), argv(1)); //TODO: sanity check, this can currently set any cvar!\r
        }\r
        fclose(fh);\r
 }\r