Changed InputFilter to not assert on unrecognized input devices or buttons.

This commit is contained in:
Kyzentun
2014-07-08 17:24:09 -06:00
committed by Jonathan Payne
parent 194c8de8f8
commit 8e74a512ad
+11 -2
View File
@@ -170,8 +170,17 @@ void InputFilter::ButtonPressed( const DeviceInput &di )
if( di.ts.IsZero() )
LOG->Warn( "InputFilter::ButtonPressed: zero timestamp is invalid" );
ASSERT_M( di.device < NUM_InputDevice, ssprintf("Invalid device %i", di.device) );
ASSERT_M( di.button < NUM_DeviceButton, ssprintf("Invalid button %i", di.button) );
// Filter out input that is beyond the range of the current system.
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 );