From 90ffa604bbb57e5dd12a6ac1d5b3eae1ad929a1a Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Sat, 6 Aug 2011 22:27:31 +0000 Subject: [PATCH] uiScript resetDefaults --- reaction/code/ui/ui_main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/reaction/code/ui/ui_main.c b/reaction/code/ui/ui_main.c index c5c7d78d..f80ebcb2 100644 --- a/reaction/code/ui/ui_main.c +++ b/reaction/code/ui/ui_main.c @@ -6097,9 +6097,18 @@ static void UI_RunMenuScript(char **args) UI_GameType_HandleKey(0, 0, K_MOUSE1, qfalse); UI_GameType_HandleKey(0, 0, K_MOUSE2, qfalse); } else if (Q_stricmp(name, "resetDefaults") == 0) { - trap_Cmd_ExecuteText(EXEC_APPEND, "exec default.cfg\n"); + // Makro - changed the order a bit + + // First we reset the cvars, then we exec default.cfg to have + // all of them initialized with the proper values, even (c)game cvars + // when (c)game isn't loaded yet. + + // Also, Controls_SetDefaults() is no longer called because we already + // set up default bindings in default.cfg + trap_Cmd_ExecuteText(EXEC_APPEND, "cvar_restart\n"); - Controls_SetDefaults(); + trap_Cmd_ExecuteText(EXEC_APPEND, "exec default.cfg\n"); + //Controls_SetDefaults(); trap_Cvar_Set("com_introPlayed", "1"); trap_Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n"); } else if (Q_stricmp(name, "getCDKey") == 0) {