From ca22d71ba43aefdc0e69470629bf9c61afa2a9fc Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 5 Sep 2005 02:19:01 +0000 Subject: [PATCH] check invalid values in MultiPlayer conversions --- stepmania/src/InputMapper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 4d7d72f126..fd4e8da185 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -697,11 +697,15 @@ void InputMapper::ResetKeyRepeat( StyleInput StyleI ) InputDevice InputMapper::MultiPlayerToInputDevice( MultiPlayer mp ) { + if( mp == MultiPlayer_INVALID ) + return DEVICE_NONE; return (InputDevice)(mp + DEVICE_JOY1); } MultiPlayer InputMapper::InputDeviceToMultiPlayer( InputDevice id ) { + if( id == DEVICE_NONE ) + return MultiPlayer_INVALID; return (MultiPlayer)(id - DEVICE_JOY1); }