- fixed key binding

This commit is contained in:
Christoph Oelckers 2019-11-06 20:34:00 +01:00
parent 5d31119a49
commit 81e9c867da

View file

@ -314,7 +314,6 @@ void FGameConfigFile::DoGameSetup (const char *gamename)
// Moved from DoGameSetup so that it can happen after wads are loaded // Moved from DoGameSetup so that it can happen after wads are loaded
void FGameConfigFile::DoKeySetup(const char *gamename) void FGameConfigFile::DoKeySetup(const char *gamename)
{ {
/*
static const struct { const char *label; FKeyBindings *bindings; } binders[] = static const struct { const char *label; FKeyBindings *bindings; } binders[] =
{ {
{ "Bindings", &Bindings }, { "Bindings", &Bindings },
@ -322,7 +321,6 @@ void FGameConfigFile::DoKeySetup(const char *gamename)
{ "AutomapBindings", &AutomapBindings }, { "AutomapBindings", &AutomapBindings },
{ NULL, NULL } { NULL, NULL }
}; };
*/
sublen = countof(section) - 1 - snprintf(section, countof(section), "%s.", gamename); sublen = countof(section) - 1 - snprintf(section, countof(section), "%s.", gamename);
subsection = section + countof(section) - sublen - 1; subsection = section + countof(section) - sublen - 1;
@ -330,7 +328,6 @@ void FGameConfigFile::DoKeySetup(const char *gamename)
//C_SetDefaultBindings (); //C_SetDefaultBindings ();
#if 0
const char* key, * value; const char* key, * value;
for (int i = 0; binders[i].label != NULL; ++i) for (int i = 0; binders[i].label != NULL; ++i)
{ {
@ -345,21 +342,6 @@ void FGameConfigFile::DoKeySetup(const char *gamename)
} }
} }
} }
#else
strncpy(subsection, "Bindings", sublen);
if (SetSection(section))
{
const char* key;
const char* value;
C_DoCommand("unbindall");
while (NextInSection(key, value))
{
FStringf cmd("bind %s \"%s\"", key, value);
C_DoCommand(cmd);
}
}
#endif
OkayToWrite = true; OkayToWrite = true;
} }