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
This commit is contained in:
svdijk 2012-09-12 20:14:20 +00:00
parent 9b7a0deb8f
commit 04bb30a48a
2 changed files with 6 additions and 2 deletions

View File

@ -81,6 +81,8 @@ cvar_t developer = {"developer","0",CVAR_NONE};
cvar_t temp1 = {"temp1","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 cvar_t devstats = {"devstats","0",CVAR_NONE}; //johnfitz -- track developer statistics that vary every frame
devstats_t dev_stats, dev_peakstats; devstats_t dev_stats, dev_peakstats;
@ -280,6 +282,8 @@ void Host_InitLocal (void)
Cvar_RegisterVariable (&temp1); Cvar_RegisterVariable (&temp1);
Cvar_RegisterVariable (&cfg_unbindall); //QuakeSpasm
Host_FindMaxClients (); Host_FindMaxClients ();
host_time = 1.0; // so a think at time 0 won't get called 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 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); Key_WriteBindings (f);
Cvar_WriteVariables (f); Cvar_WriteVariables (f);

View File

@ -661,8 +661,6 @@ void Key_WriteBindings (FILE *f)
{ {
int i; int i;
fprintf (f, "unbindall\n");
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
{ {
if (keybindings[i] && *keybindings[i]) if (keybindings[i] && *keybindings[i])