From c6e6ad24ad3b4328798a4fc0a47dc2cf1881b799 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sat, 23 May 2009 05:59:41 +0000 Subject: [PATCH] fix crash that happened when LateJoin and Doubles for 1 Credit were enabled and Doubles was selected ("No compatible styles for [insert game and styletype] with 2 players."). todo: The non-master player's CreditsDisplay still shows "Insert Card", unlike themes without LateJoin on. Not sure how to go about fixing this; hoped SetCurrentStyle(Style) would've done it but was not the case. --- stepmania/src/GameState.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index c52422b0c0..bae1c1ffbd 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -354,8 +354,16 @@ void GameState::JoinPlayer( PlayerNumber pn ) // Set the current style to something appropriate for the new number of joined players. if( ALLOW_LATE_JOIN && m_pCurStyle != NULL ) { - const Style *pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), m_pCurStyle->m_StepsType ); - m_pCurStyle.Set( pStyle ); + const Style *pStyle; + // only use one player for StyleType_OnePlayerTwoSides. + // XXX: still shows non master player's "Insert Card" -aj + if( m_pCurStyle->m_StyleType == StyleType_OnePlayerTwoSides ) + pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, 1, m_pCurStyle->m_StepsType ); + else + pStyle = GameManager::GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), m_pCurStyle->m_StepsType ); + + // use SetCurrentStyle in case of StyleType_OnePlayerTwoSides + SetCurrentStyle( pStyle ); } Message msg( MessageIDToString(Message_PlayerJoined) );