From 04bb30a48a8619ae9ab62aeff3e658fc345f468d Mon Sep 17 00:00:00 2001 From: svdijk Date: Wed, 12 Sep 2012 20:14:20 +0000 Subject: [PATCH] Make the "unbindall" in config.cfg configurable (on by default) git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@722 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/host.c | 6 ++++++ Quake/keys.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Quake/host.c b/Quake/host.c index 48fc92a2..9337fe2b 100644 --- a/Quake/host.c +++ b/Quake/host.c @@ -81,6 +81,8 @@ cvar_t developer = {"developer","0",CVAR_NONE}; cvar_t temp1 = {"temp1","0",CVAR_NONE}; +cvar_t cfg_unbindall = {"cfg_unbindall", "1", CVAR_ARCHIVE}; //QuakeSpasm + cvar_t devstats = {"devstats","0",CVAR_NONE}; //johnfitz -- track developer statistics that vary every frame devstats_t dev_stats, dev_peakstats; @@ -280,6 +282,8 @@ void Host_InitLocal (void) Cvar_RegisterVariable (&temp1); + Cvar_RegisterVariable (&cfg_unbindall); //QuakeSpasm + Host_FindMaxClients (); host_time = 1.0; // so a think at time 0 won't get called @@ -310,6 +314,8 @@ void Host_WriteConfiguration (void) VID_SyncCvars (); //johnfitz -- write actual current mode to config file, in case cvars were messed with + if (cfg_unbindall.value) fprintf (f, "unbindall\n"); //QuakeSpasm -- unbindall before loading stored bindings + Key_WriteBindings (f); Cvar_WriteVariables (f); diff --git a/Quake/keys.c b/Quake/keys.c index 9ad08a20..7992a4f1 100644 --- a/Quake/keys.c +++ b/Quake/keys.c @@ -661,8 +661,6 @@ void Key_WriteBindings (FILE *f) { int i; - fprintf (f, "unbindall\n"); - for (i = 0; i < 256; i++) { if (keybindings[i] && *keybindings[i])