Simplify and clarify.
This commit is contained in:
+10
-14
@@ -304,12 +304,6 @@ const StyleDef* GameState::GetCurrentStyleDef()
|
|||||||
|
|
||||||
bool GameState::IsPlayable( const ModeChoice& mc )
|
bool GameState::IsPlayable( const ModeChoice& mc )
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// If the ModeChoice doesn't specify something, we'll take that
|
|
||||||
// value from the current game state
|
|
||||||
//
|
|
||||||
const PlayMode &rPlayMode = mc.pm != PLAY_MODE_INVALID? mc.pm:m_PlayMode;
|
|
||||||
|
|
||||||
if ( mc.style != STYLE_INVALID )
|
if ( mc.style != STYLE_INVALID )
|
||||||
{
|
{
|
||||||
const int SidesJoinedToPlay = GAMEMAN->GetStyleDefForStyle(mc.style)->NumSidesJoinedToPlay();
|
const int SidesJoinedToPlay = GAMEMAN->GetStyleDefForStyle(mc.style)->NumSidesJoinedToPlay();
|
||||||
@@ -317,22 +311,24 @@ bool GameState::IsPlayable( const ModeChoice& mc )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rPlayMode == PLAY_MODE_RAVE || rPlayMode == PLAY_MODE_BATTLE )
|
if( mc.pm == PLAY_MODE_RAVE || mc.pm == PLAY_MODE_BATTLE )
|
||||||
{
|
{
|
||||||
// Can't play Rave without characters for attack definitions.
|
// Can't play Rave without characters for attack definitions.
|
||||||
if( m_pCharacters.empty() )
|
if( m_pCharacters.empty() )
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// If there is no current style ... well, we have no reasonable
|
/* Don't set a PlayMode that's incompatible with our current Style (if any),
|
||||||
// grounds to disallow
|
* and vice versa. */
|
||||||
const Style &rStyle = mc.style != STYLE_INVALID? mc.style: m_CurStyle;
|
const PlayMode &rPlayMode = mc.pm != PLAY_MODE_INVALID? mc.pm:m_PlayMode;
|
||||||
if (rStyle == STYLE_INVALID)
|
if( rPlayMode == PLAY_MODE_RAVE || rPlayMode == PLAY_MODE_BATTLE )
|
||||||
return true;
|
{
|
||||||
|
|
||||||
// Can't play rave if there isn't enough room for two players.
|
// Can't play rave if there isn't enough room for two players.
|
||||||
// This is correct for dance (ie, no rave for solo and doubles),
|
// This is correct for dance (ie, no rave for solo and doubles),
|
||||||
// and should be okay for pump .. not sure about other game types.
|
// and should be okay for pump .. not sure about other game types.
|
||||||
if( GAMEMAN->GetStyleDefForStyle(rStyle)->m_iColsPerPlayer >= 6 )
|
const Style &rStyle = mc.style != STYLE_INVALID? mc.style: m_CurStyle;
|
||||||
|
if( rStyle != STYLE_INVALID &&
|
||||||
|
GAMEMAN->GetStyleDefForStyle(rStyle)->m_iColsPerPlayer >= 6 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user