Joystick configuration no longer gets discarded when joystick type is set to 0 (standard 2-button joystick), fixes saving joystick settings for that joystick type.

This commit is contained in:
OBattler
2018-10-06 20:42:13 +02:00
parent 0b6a026215
commit c2bbe59949

View File

@@ -8,7 +8,7 @@
* *
* Configuration file handler. * Configuration file handler.
* *
* Version: @(#)config.c 1.0.55 2018/10/02 * Version: @(#)config.c 1.0.56 2018/10/06
* *
* Authors: Sarah Walker, * Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -1467,11 +1467,8 @@ save_input_devices(void)
config_set_string(cat, "mouse_type", mouse_get_internal_name(mouse_type)); config_set_string(cat, "mouse_type", mouse_get_internal_name(mouse_type));
if ((joystick_type == 0) || (joystick_type == 7)) { if (joystick_type == 7) {
if (joystick_type == 7)
config_delete_var(cat, "joystick_type"); config_delete_var(cat, "joystick_type");
else
config_set_int(cat, "joystick_type", joystick_type);
for (c = 0; c < 16; c++) { for (c = 0; c < 16; c++) {
sprintf(tmp2, "joystick_%i_nr", c); sprintf(tmp2, "joystick_%i_nr", c);