From aa2062e38011623affaa547238be8e0498f0c8e4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 6 Dec 2004 05:34:40 +0000 Subject: [PATCH] cleanup fix hold notes on 2p side --- stepmania/src/Style.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/stepmania/src/Style.cpp b/stepmania/src/Style.cpp index 681252771c..b7afd6fa06 100644 --- a/stepmania/src/Style.cpp +++ b/stepmania/src/Style.cpp @@ -43,6 +43,9 @@ GameInput Style::StyleInputToGameInput( const StyleInput& StyleI ) const FOREACH_GameController(gc) { + if( this->m_StyleType != ONE_PLAYER_TWO_SIDES && gc != (int) StyleI.player ) + continue; + for( int i = 0; i < m_pGame->m_iButtonsPerController && m_iInputColumn[gc][i] != END_MAPPING; ++i ) if( m_iInputColumn[gc][i] == StyleI.col ) return GameInput( gc, i ); @@ -62,12 +65,7 @@ StyleInput Style::GameInputToStyleInput( const GameInput &GameI ) const if( m_iInputColumn[GameI.controller][i] == END_MAPPING ) return SI; // Return invalid. - SI = StyleInput( (PlayerNumber) GameI.controller, m_iInputColumn[GameI.controller][GameI.button] ); - - // HACK: Looking up the player number using m_ColumnInfo - // returns the wrong answer for ONE_PLAYER_TWO_SIDES styles - if( m_StyleType == ONE_PLAYER_TWO_SIDES ) - SI.player = GAMESTATE->m_MasterPlayerNumber; + SI = StyleInput( ControllerToPlayerNumber(GameI.controller), m_iInputColumn[GameI.controller][GameI.button] ); return SI; }