Fix max_buttons_per_joystick=0 max_hats_per_joystick!=0 build

Internally, hats are treated as a group of 4 buttons.  Disabling all
buttons while not disabling all hats caused a build error.  Since no one
reported this, this configuration is likely not used.  Make the simple
fix of coercing max_hats_per_joystick to 0 when max_axes_per_joystick is
0.
This commit is contained in:
Kp 2017-12-24 00:28:35 +00:00
parent 44154f155a
commit c09aab491b

View file

@ -1149,6 +1149,8 @@ static void terminate_handler()
# disabled, then disable joystick support.
if not (user_settings.max_axes_per_joystick or user_settings.max_buttons_per_joystick or user_settings.max_hats_per_joystick):
user_settings.max_joysticks = 0
elif not user_settings.max_buttons_per_joystick:
user_settings.max_hats_per_joystick = 0
else:
# If joysticks are disabled, then disable all possible
# inputs.