Changed InputFilter to not assert on unrecognized input devices or buttons.
This commit is contained in:
+11
-2
@@ -170,8 +170,17 @@ void InputFilter::ButtonPressed( const DeviceInput &di )
|
|||||||
if( di.ts.IsZero() )
|
if( di.ts.IsZero() )
|
||||||
LOG->Warn( "InputFilter::ButtonPressed: zero timestamp is invalid" );
|
LOG->Warn( "InputFilter::ButtonPressed: zero timestamp is invalid" );
|
||||||
|
|
||||||
ASSERT_M( di.device < NUM_InputDevice, ssprintf("Invalid device %i", di.device) );
|
// Filter out input that is beyond the range of the current system.
|
||||||
ASSERT_M( di.button < NUM_DeviceButton, ssprintf("Invalid button %i", di.button) );
|
if(di.device >= NUM_InputDevice)
|
||||||
|
{
|
||||||
|
LOG->Trace("InputFilter::ButtonPressed: Invalid device %i", di.device);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(di.button >= NUM_DeviceButton)
|
||||||
|
{
|
||||||
|
LOG->Trace("InputFilter::ButtonPressed: Invalid button %i", di.button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ButtonState &bs = GetButtonState( di );
|
ButtonState &bs = GetButtonState( di );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user