From c2bbe59949235b69e355be2c86e4b0e123398edc Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 6 Oct 2018 20:42:13 +0200 Subject: [PATCH] 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. --- src/config.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/config.c b/src/config.c index 6cf46f62e..57e0727c6 100644 --- a/src/config.c +++ b/src/config.c @@ -8,7 +8,7 @@ * * Configuration file handler. * - * Version: @(#)config.c 1.0.55 2018/10/02 + * Version: @(#)config.c 1.0.56 2018/10/06 * * Authors: Sarah Walker, * Miran Grca, @@ -1467,13 +1467,10 @@ save_input_devices(void) config_set_string(cat, "mouse_type", mouse_get_internal_name(mouse_type)); - if ((joystick_type == 0) || (joystick_type == 7)) { - if (joystick_type == 7) - config_delete_var(cat, "joystick_type"); - else - config_set_int(cat, "joystick_type", joystick_type); + if (joystick_type == 7) { + config_delete_var(cat, "joystick_type"); - for (c=0; c<16; c++) { + for (c = 0; c < 16; c++) { sprintf(tmp2, "joystick_%i_nr", c); config_delete_var(cat, tmp2); @@ -1493,7 +1490,7 @@ save_input_devices(void) } else { config_set_int(cat, "joystick_type", joystick_type); - for (c=0; c