Skip to content

Commit

Permalink
Pad: fix crash on touching disabled slider in macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
TellowKrinkle committed Feb 4, 2021
1 parent 4890a26 commit 84e0f31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pcsx2/PAD/Linux/wx_dialog/GamepadConfiguration.cpp
Expand Up @@ -105,14 +105,16 @@ 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)
{
g_conf.set_ff_intensity(m_sl_rumble_intensity->GetValue());

// 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)
{
Expand Down

0 comments on commit 84e0f31

Please sign in to comment.