game: fix missing event.type comparison in joystick axis motion handler (pressure sensitive axii) (#4286)

`SDL_EVENT_JOYSTICK_AXIS_MOTION` is an enum with `Value = 1536`, which
means the code current acts like: `else if (true &&
m_has_pressure_sensitive_buttons)`
This commit is contained in:
tripp
2026-05-27 21:28:02 -04:00
committed by GitHub
parent 704972dd6a
commit c010073ddc
+1 -1
View File
@@ -248,7 +248,7 @@ void GameController::process_event(const SDL_Event& event,
}
}
}
} else if (SDL_EVENT_JOYSTICK_AXIS_MOTION && m_has_pressure_sensitive_buttons) {
} else if (event.type == SDL_EVENT_JOYSTICK_AXIS_MOTION && m_has_pressure_sensitive_buttons) {
// handle changes in pressure on axii not mapped to the gamepad (ie. PS3 analog buttons)
if (m_settings->enable_pressure_sensitivity &&
pressure_axes_to_button.contains(event.jaxis.axis)) {