From bc0cf8acd171ad8c99663d5f644bf9990640a177 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 11 Jun 2008 22:19:43 +0000 Subject: [PATCH] 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. --- stepmania/src/ScreenWithMenuElements.cpp | 7 +++---- stepmania/src/StepMania.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index f272992b72..1c43a98290 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -128,12 +128,11 @@ void ScreenWithMenuElements::BeginScreen() /* Evaluate FirstUpdateCommand. */ this->PlayCommand( "FirstUpdate" ); - /* If AutoJoin is enabled, we may have a credit that couldn't be used to join when - * the coin was inserted due to AllowLateJoin being disabled at the time. Try to - * join players when a new screen starts. */ + /* If AutoJoin and a player is already joined, then try to join a player. (If no players + * are joined, they'll join on the first JoinInput.) */ if( GAMESTATE->GetCoinMode() == CoinMode_Pay && GAMESTATE->m_bAutoJoin.Get() ) { - if( GAMESTATE->JoinPlayers() ) + if( GAMESTATE->GetNumSidesJoined() > 0 && GAMESTATE->JoinPlayers() ) SCREENMAN->PlayStartSound(); } } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 5ee258194a..c312ceddff 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1198,10 +1198,11 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping ) else SCREENMAN->PlayInvalidSound(); - /* If AutoJoin and enough coins to join have been inserted, then try to join a player. */ - if( GAMESTATE->m_bAutoJoin.Get() ) + /* If AutoJoin and a player is already joined, then try to join a player. (If no players + * 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(); }