by phantombeta » Wed Dec 14, 2022 2:14 pm
One important detail to note is that the binds are only cleared
in-game- They are indeed saved correctly to the INI, they just get wiped from the game in the process. (Then consequently get wiped from the INI too once you close the game)
The "Browse Game Config" option causes this because it also saves the game.
Some quick investigation points to
ArchiveBindings as the likely culprit for this bug. The comment right before it also kinda points to that being the case:
Code: Select all
//=============================================================================
//
// This function is first called for functions in custom key sections.
// In this case, matchcmd is non-null, and only keys bound to that command
// are stored. If a match is found, its binding is set to "\1".
// After all custom key sections are saved, it is called one more for the
// normal Bindings and DoubleBindings sections for this game. In this case
// matchcmd is null and all keys will be stored. The config section was not
// previously cleared, so all old bindings are still in place. If the binding
// for a key is empty, the corresponding key in the config is removed as well.
// If a binding is "\1", then the binding itself is cleared, but nothing
// happens to the entry in the config.
//
//=============================================================================
The origin of this code is
this commit from... 2009.
How has this bug never been reported and/or fixed during those 13+ years? O_o
One important detail to note is that the binds are only cleared [i]in-game[/i]- They are indeed saved correctly to the INI, they just get wiped from the game in the process. (Then consequently get wiped from the INI too once you close the game)
The "Browse Game Config" option causes this because it also saves the game.
Some quick investigation points to [url=https://github.com/ZDoom/gzdoom/blob/de65d1b96fc7ead93ca7dfa262d39d10651bb913/src/common/console/c_bind.cpp#L404]ArchiveBindings[/url] as the likely culprit for this bug. The comment right before it also kinda points to that being the case:
[code]
//=============================================================================
//
// This function is first called for functions in custom key sections.
// In this case, matchcmd is non-null, and only keys bound to that command
// are stored. If a match is found, its binding is set to "\1".
// After all custom key sections are saved, it is called one more for the
// normal Bindings and DoubleBindings sections for this game. In this case
// matchcmd is null and all keys will be stored. The config section was not
// previously cleared, so all old bindings are still in place. If the binding
// for a key is empty, the corresponding key in the config is removed as well.
// If a binding is "\1", then the binding itself is cleared, but nothing
// happens to the entry in the config.
//
//=============================================================================
[/code]
The origin of this code is [url=https://github.com/ZDoom/gzdoom/commit/8d9bc8cc67335a07b9bde0df5decfe5810bf5715]this commit[/url] from... 2009.
How has this bug never been reported and/or fixed during those 13+ years? O_o