AutoJoin logic change: Rather than always joining on any coin input,
join on the first JoinInput; later (if more coins are input), join on coin input if there's already a player joined. This means coin inputs never join the first player, which implies that coin inputs can only autojoin a player if it's in a place where players are supposed to be joined. This avoids problems with joining too early, eg. in Attract before Reset.
This commit is contained in:
@@ -128,12 +128,11 @@ void ScreenWithMenuElements::BeginScreen()
|
|||||||
/* Evaluate FirstUpdateCommand. */
|
/* Evaluate FirstUpdateCommand. */
|
||||||
this->PlayCommand( "FirstUpdate" );
|
this->PlayCommand( "FirstUpdate" );
|
||||||
|
|
||||||
/* If AutoJoin is enabled, we may have a credit that couldn't be used to join when
|
/* If AutoJoin and a player is already joined, then try to join a player. (If no players
|
||||||
* the coin was inserted due to AllowLateJoin being disabled at the time. Try to
|
* are joined, they'll join on the first JoinInput.) */
|
||||||
* join players when a new screen starts. */
|
|
||||||
if( GAMESTATE->GetCoinMode() == CoinMode_Pay && GAMESTATE->m_bAutoJoin.Get() )
|
if( GAMESTATE->GetCoinMode() == CoinMode_Pay && GAMESTATE->m_bAutoJoin.Get() )
|
||||||
{
|
{
|
||||||
if( GAMESTATE->JoinPlayers() )
|
if( GAMESTATE->GetNumSidesJoined() > 0 && GAMESTATE->JoinPlayers() )
|
||||||
SCREENMAN->PlayStartSound();
|
SCREENMAN->PlayStartSound();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1198,10 +1198,11 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping )
|
|||||||
else
|
else
|
||||||
SCREENMAN->PlayInvalidSound();
|
SCREENMAN->PlayInvalidSound();
|
||||||
|
|
||||||
/* If AutoJoin and enough coins to join have been inserted, then try to join a player. */
|
/* If AutoJoin and a player is already joined, then try to join a player. (If no players
|
||||||
if( GAMESTATE->m_bAutoJoin.Get() )
|
* are joined, they'll join on the first JoinInput.) */
|
||||||
|
if( GAMESTATE->m_bAutoJoin.Get() && GAMESTATE->GetNumSidesJoined() > 0 )
|
||||||
{
|
{
|
||||||
if( GAMESTATE->JoinPlayers() )
|
if( GAMESTATE->GetNumSidesJoined() > 0 && GAMESTATE->JoinPlayers() )
|
||||||
SCREENMAN->PlayStartSound();
|
SCREENMAN->PlayStartSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user