[TLAC] Fix crash when an Xinput is connected, the slider emulator is disabled, and rumble is enabled
This commit is contained in:
@@ -47,6 +47,8 @@ namespace TLAC::Components
|
||||
componentsManager = manager;
|
||||
sliderState = (TouchSliderState*)SLIDER_CTRL_TASK_ADDRESS;
|
||||
|
||||
touchSliderEmulatorIsEnabled = true;
|
||||
|
||||
LeftSideSlideLeft = new Binding();
|
||||
LeftSideSlideRight = new Binding();
|
||||
|
||||
|
||||
@@ -60,5 +60,7 @@ namespace TLAC::Components
|
||||
void ApplyContactPoint(ContactPoint &contactPoint, int section);
|
||||
void ApplyBitfieldState(uint32_t state);
|
||||
};
|
||||
|
||||
inline bool touchSliderEmulatorIsEnabled = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace TLAC::Input
|
||||
SetTapStates(i, elapsed);
|
||||
}
|
||||
|
||||
if (rumble && TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched() && TLAC::Components::TargetInspector::ShouldVibrate)
|
||||
if (rumble && TLAC::Components::touchSliderEmulatorIsEnabled && TLAC::Components::TouchSliderEmulator::LatestInstance->isSliderTouched() && TLAC::Components::TargetInspector::ShouldVibrate)
|
||||
{
|
||||
XINPUT_VIBRATION vibration;
|
||||
ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION));
|
||||
|
||||
Reference in New Issue
Block a user