Fix crash when render loading polling joystick event

This commit is contained in:
Benau 2020-06-02 15:14:09 +08:00
parent 7d16f2456a
commit d7695cb0a7

View File

@ -734,6 +734,10 @@ void InputManager::dispatchInput(Input::InputType type, int deviceID,
Input::AxisDirection axisDirection, int value, Input::AxisDirection axisDirection, int value,
bool shift_mask) bool shift_mask)
{ {
// Updated in rendering from main loop
if (!irr_driver->getDevice()->getEventReceiver())
return;
// Act different in input sensing mode. // Act different in input sensing mode.
if (m_mode == INPUT_SENSE_KEYBOARD || if (m_mode == INPUT_SENSE_KEYBOARD ||
m_mode == INPUT_SENSE_GAMEPAD) m_mode == INPUT_SENSE_GAMEPAD)