foxygit / doom Log in
commit fdc44b009d1beaf57e4d1762e3dc9ed038e8fd7e
Author:     Michael Day <contact@michaelcday.com>
AuthorDate: Fri Aug 18 10:56:49 2023 -0400
Commit:     Turo Lamminen <turol@users.noreply.github.com>
CommitDate: Wed Aug 23 11:42:50 2023 +0300

    Keep joystick settings when aborting calibration
---
 src/setup/joystick.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index 62589cda..dc687182 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -1001,6 +1001,7 @@ static int CalibrationEventCallback(SDL_Event *event, void *user_data)
     // In the first "center" stage, we're just trying to work out which
     // joystick is being configured and which button the user is pressing.
     usejoystick = 1;
+    use_gamepad = 0;
     gamepad_type = SDL_CONTROLLER_TYPE_UNKNOWN;
     calibrate_button = event->jbutton.button;

@@ -1090,9 +1091,6 @@ static void CalibrateJoystick(TXT_UNCAST_ARG(widget),
                       joystick_window);

     // Start calibration
-    usejoystick = 0;
-    use_gamepad = 0;
-    joystick_index = -1;
 }

 //