From: MirceaKitsune Date: Tue, 28 Sep 2010 15:09:01 +0000 (+0300) Subject: Better Instant Action system X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e3bd4be5d943df7c5be185188eed8ca729f22366;p=voretournament%2Fvoretournament.git Better Instant Action system --- diff --git a/data/qcsrc/menu/voret/dialog_singleplayer.c b/data/qcsrc/menu/voret/dialog_singleplayer.c index 4fdc074d..c69854ef 100644 --- a/data/qcsrc/menu/voret/dialog_singleplayer.c +++ b/data/qcsrc/menu/voret/dialog_singleplayer.c @@ -26,18 +26,8 @@ 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) == "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) == "changelevel") + if(argv(0) == "changelevel") { fclose(fh); localcmd("\nmenu_loadmap_prepare\n"); @@ -46,6 +36,8 @@ void InstantAction_LoadMap(entity btn, entity dummy) cvar_set("lastlevel", "1"); return; } + 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); }