fix "PlayersFinalized executes twice"

This commit is contained in:
Chris Danford
2004-04-23 02:08:11 +00:00
parent 7a47504507
commit ab1d3bfd0e
3 changed files with 16 additions and 4 deletions
+6 -2
View File
@@ -85,6 +85,7 @@ void GameState::Reset()
m_CurStyle = STYLE_INVALID; m_CurStyle = STYLE_INVALID;
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
m_bSideIsJoined[p] = false; m_bSideIsJoined[p] = false;
m_bPlayersFinalized = false;
// m_iCoins = 0; // don't reset coin count! // m_iCoins = 0; // don't reset coin count!
m_MasterPlayerNumber = PLAYER_INVALID; m_MasterPlayerNumber = PLAYER_INVALID;
m_sPreferredGroup = GROUP_ALL_MUSIC; m_sPreferredGroup = GROUP_ALL_MUSIC;
@@ -195,6 +196,11 @@ void CheckStageStats( const StageStats &ss, int p )
void GameState::PlayersFinalized() void GameState::PlayersFinalized()
{ {
if( m_bPlayersFinalized )
return;
m_bPlayersFinalized = true;
MEMCARDMAN->LockCards( true ); MEMCARDMAN->LockCards( true );
SONGMAN->LoadAllFromProfiles(); SONGMAN->LoadAllFromProfiles();
@@ -224,8 +230,6 @@ void GameState::PlayersFinalized()
if( m_pCurSong == NULL && pProfile->m_pLastSong ) if( m_pCurSong == NULL && pProfile->m_pLastSong )
m_pCurSong = pProfile->m_pLastSong; m_pCurSong = pProfile->m_pLastSong;
} }
} }
/* This data is added to each player profile, and to the machine profile per-player. */ /* This data is added to each player profile, and to the machine profile per-player. */
+1
View File
@@ -53,6 +53,7 @@ public:
Game m_CurGame; Game m_CurGame;
Style m_CurStyle; Style m_CurStyle;
bool m_bSideIsJoined[NUM_PLAYERS]; // left side, right side bool m_bSideIsJoined[NUM_PLAYERS]; // left side, right side
bool m_bPlayersFinalized;
PlayMode m_PlayMode; // many screens display different info depending on this value PlayMode m_PlayMode; // many screens display different info depending on this value
int m_iCoins; // not "credits" int m_iCoins; // not "credits"
PlayerNumber m_MasterPlayerNumber; // used in Styles where one player controls both sides PlayerNumber m_MasterPlayerNumber; // used in Styles where one player controls both sides
+9 -2
View File
@@ -36,6 +36,7 @@
#include "SongUtil.h" #include "SongUtil.h"
#include "StepsUtil.h" #include "StepsUtil.h"
#include "CourseUtil.h" #include "CourseUtil.h"
#include "RageFileManager.h"
SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program
@@ -954,9 +955,12 @@ void SongManager::UpdateRankingCourses()
void SongManager::LoadAllFromProfiles() void SongManager::LoadAllFromProfiles()
{ {
for( int s=0; s<NUM_PROFILE_SLOTS; s++ ) FOREACH_ProfileSlot( s )
{ {
CString sProfileDir = PROFILEMAN->GetProfileDir( (ProfileSlot)s ); if( !PROFILEMAN->IsUsingProfile(s) )
continue;
CString sProfileDir = PROFILEMAN->GetProfileDir( s );
if( sProfileDir.empty() ) if( sProfileDir.empty() )
continue; // skip continue; // skip
// //
@@ -964,6 +968,9 @@ void SongManager::LoadAllFromProfiles()
// //
{ {
CString sEditsDir = sProfileDir+"Edits/"; CString sEditsDir = sProfileDir+"Edits/";
FILEMAN->FlushDirCache( sEditsDir );
CStringArray asEditsFilesWithPath; CStringArray asEditsFilesWithPath;
GetDirListing( sEditsDir+"*.sm", asEditsFilesWithPath, false, true ); GetDirListing( sEditsDir+"*.sm", asEditsFilesWithPath, false, true );