From: MirceaKitsune Date: Tue, 28 Sep 2010 15:41:21 +0000 (+0300) Subject: Switch to the old (safer) instantaction system. With the only exception of allowing... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cafcc52d6d6a1e364861171d33ebfa43f5935b99;p=voretournament%2Fvoretournament.git Switch to the old (safer) instantaction system. With the only exception of allowing the gametype to be set. --- 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); }