From cc8afe0f242e5129d2b481c6c4659f72c44dc935 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 1 Oct 2003 01:52:21 +0000 Subject: [PATCH] Fix second controllers with secondary auto-mappings automapping incorrectly. --- stepmania/src/InputMapper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 632f3a5fb5..bef3917f32 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -274,7 +274,16 @@ void InputMapper::AutoMapJoysticksForCurrentGame() for( int k=0; mapping.maps[k].iSlotIndex != -1; k++ ) { if( mapping.maps[k].SecondController ) - gc = GAME_CONTROLLER_2; + { + gc = (GameController)(gc+1); + + /* If that pushed it over, then it's a second controller for + * a joystick that's already a second controller, so we'll + * just ignore it. (This can happen if eg. two primary + * Pump pads are connected.) */ + if( gc >= GAME_CONTROLLER_INVALID ) + continue; + } DeviceInput di( device, mapping.maps[k].deviceButton ); GameInput gi( gc, mapping.maps[k].gb );