From cafcc52d6d6a1e364861171d33ebfa43f5935b99 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 28 Sep 2010 18:41:21 +0300 Subject: [PATCH] Switch to the old (safer) instantaction system. With the only exception of allowing the gametype to be set. --- data/qcsrc/menu/voret/dialog_singleplayer.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/data/qcsrc/menu/voret/dialog_singleplayer.c b/data/qcsrc/menu/voret/dialog_singleplayer.c index 867b09c8..b95ffebe 100644 --- a/data/qcsrc/menu/voret/dialog_singleplayer.c +++ b/data/qcsrc/menu/voret/dialog_singleplayer.c @@ -26,8 +26,20 @@ void InstantAction_LoadMap(entity btn, entity dummy) return; while((s = fgets(fh))) { + if(substring(s, 0, 4) == "set ") + s = substring(s, 4, strlen(s) - 4); n = tokenize_console(s); - if(argv(0) == "changelevel") + if(argv(0) == "bot_number") + cvar_set("bot_number", argv(1)); + else if(argv(0) == "skill") + cvar_set("skill", argv(1)); + else if(argv(0) == "timelimit") + cvar_set("timelimit_override", argv(1)); + else if(argv(0) == "fraglimit") + cvar_set("fraglimit_override", argv(1)); + else if(argv(0) == "gametype") + MapInfo_SwitchGameType(MapInfo_Type_FromString(argv(1))); + else if(argv(0) == "changelevel") { fclose(fh); localcmd("\nmenu_loadmap_prepare\n"); @@ -35,10 +47,6 @@ void InstantAction_LoadMap(entity btn, entity dummy) cvar_set("lastlevel", "1"); return; } - else if(argv(0) == "gametype") - MapInfo_SwitchGameType(MapInfo_Type_FromString(argv(1))); - else if(argv(0) != "" && argv(0) != "//" && argv(0) != "#") - cvar_set(argv(0), argv(1)); //TODO: sanity check, this can currently set any cvar! } fclose(fh); } -- 2.39.2