From bb9932029ad75aed45cbc1454241f91c038671d9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 21 Jan 2004 06:14:49 +0000 Subject: [PATCH] fix ignoring input on inactive players --- stepmania/src/ScreenSelectCourse.cpp | 6 +++++- stepmania/src/ScreenSelectMusic.cpp | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index eafbde691d..8cc867d7f5 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -233,6 +233,11 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type, if( !GameI.IsValid() ) return; // don't care + /* XXX: What's the difference between this and StyleI.player? */ + PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller ); + if( !GAMESTATE->IsHumanPlayer(pn) ) + return; + if( m_bMadeChoice && MenuI.IsValid() && MenuI.button == MENU_BUTTON_START && !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() ) { if(m_bGoToOptions) return; /* got it already */ @@ -259,7 +264,6 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type, return; } - PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller ); if( CodeDetector::EnteredEasierDifficulty(GameI.controller) ) { if( GAMESTATE->ChangeCourseDifficulty( pn, +1 ) ) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index ccd9cea387..fb38717300 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -653,6 +653,12 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, if( !GameI.IsValid() ) return; // don't care + + /* XXX: What's the difference between this and StyleI.player? */ + PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller ); + if( !GAMESTATE->IsHumanPlayer(pn) ) + return; + if( m_bMadeChoice && MenuI.IsValid() && MenuI.button == MENU_BUTTON_START && @@ -739,8 +745,6 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, InputEventType type, } - PlayerNumber pn = GAMESTATE->GetCurrentStyleDef()->ControllerToPlayerNumber( GameI.controller ); - // TRICKY: Do default processing of MenuLeft and MenuRight before detecting // codes. Do default processing of Start AFTER detecting codes. This gives us a