From 84e0f315ad09e812d0b8e50fe70eb6f16b2d5254 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Thu, 4 Feb 2021 00:59:46 -0600 Subject: [PATCH] Pad: fix crash on touching disabled slider in macOS --- pcsx2/PAD/Linux/wx_dialog/GamepadConfiguration.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcsx2/PAD/Linux/wx_dialog/GamepadConfiguration.cpp b/pcsx2/PAD/Linux/wx_dialog/GamepadConfiguration.cpp index acb838f38e..6096bab548 100644 --- a/pcsx2/PAD/Linux/wx_dialog/GamepadConfiguration.cpp +++ b/pcsx2/PAD/Linux/wx_dialog/GamepadConfiguration.cpp @@ -105,6 +105,8 @@ void GamepadConfiguration::OnSliderReleased(wxCommandEvent& event) { wxSlider* sl_tmp = (wxSlider*)event.GetEventObject(); int sl_id = sl_tmp->GetId(); + if (!sl_tmp->IsEnabled()) // wxCocoa sends events even when the button is disabled + return; if (sl_id == rumble_slider_id) { @@ -112,7 +114,7 @@ void GamepadConfiguration::OnSliderReleased(wxCommandEvent& event) // convert in a float value between 0 and 1, and run rumble feedback. // 0 to 1 scales to 0x0 to 0x7FFF - s_vgamePad[m_pad_id]->TestForce(m_sl_rumble_intensity->GetValue() / 0x7FFF); + s_vgamePad[m_pad_id]->TestForce(m_sl_rumble_intensity->GetValue() / (float)0x7FFF); } else if (sl_id == joy_slider_id) {