fix ignoring input on inactive players
This commit is contained in:
@@ -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 ) )
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user