Changed GetFirstCompatibleStyle to not crash SM so it can be used to check whether joining is allowed. JoinPlayer and PlayersCanJoin now use GetFirstCompatibleStyle to check whether there will be a style to change to. Changed logic in PlayersCanJoin to return false at the first failed requirement.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "ScreenManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "SongManager.h"
|
||||
#include "Game.h"
|
||||
#include "GameManager.h"
|
||||
#include "GameSoundManager.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
@@ -249,6 +250,13 @@ void ScreenSelectMusic::BeginScreen()
|
||||
vector<StepsType> vst;
|
||||
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst );
|
||||
const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] );
|
||||
if(pStyle == NULL)
|
||||
{
|
||||
FAIL_M( ssprintf("No compatible styles for %s with %d player%s.",
|
||||
GAMESTATE->m_pCurGame->m_szName,
|
||||
GAMESTATE->GetNumSidesJoined(),
|
||||
GAMESTATE->GetNumSidesJoined()==1?"":"s") );
|
||||
}
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user