From 1fa16a9aa94da30bcbbfc0e03091de0c269398c6 Mon Sep 17 00:00:00 2001 From: Vecais Dumais Laacis Date: Mon, 24 Sep 2007 21:49:12 +0000 Subject: [PATCH] allow to continue if local profile count is less than human player count --- stepmania/src/ScreenSelectProfile.cpp | 15 +++++++++++++-- stepmania/src/ScreenSelectProfile.h | 8 ++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/stepmania/src/ScreenSelectProfile.cpp b/stepmania/src/ScreenSelectProfile.cpp index 717e299726..0dc1364f70 100644 --- a/stepmania/src/ScreenSelectProfile.cpp +++ b/stepmania/src/ScreenSelectProfile.cpp @@ -71,11 +71,14 @@ bool ScreenSelectProfile::Finish(){ return false; } + int iUsedLocalProfiles = 0; + int iUnselectedProfiles = 0; + FOREACH_PlayerNumber( p ) { // not all players has made their choices if( GAMESTATE->IsHumanPlayer( p ) && ( m_iSelectedProfiles[p] == -1 ) ) - return false; + iUnselectedProfiles++; // card not ready if( m_iSelectedProfiles[p] == 0 && MEMCARDMAN->GetCardState( p ) != MemoryCardState_Ready ) @@ -84,8 +87,16 @@ bool ScreenSelectProfile::Finish(){ // profile index too big if( m_iSelectedProfiles[p] > PROFILEMAN->GetNumLocalProfiles() ) return false; + + //inc used profile count + if( m_iSelectedProfiles[p] > 0 ) + iUsedLocalProfiles++; } + //this allows to continue if there is less local profiles than number of human players + if( iUnselectedProfiles && iUsedLocalProfiles < PROFILEMAN->GetNumLocalProfiles() ) + return false; + // all ok - load profiles and go to next screen FOREACH_PlayerNumber( p ) { @@ -162,7 +173,7 @@ public: LUA_REGISTER_DERIVED_CLASS( ScreenSelectProfile, ScreenWithMenuElements ) /* -* (c) 2004 Chris Danford +* (c) 2007 vdl * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/stepmania/src/ScreenSelectProfile.h b/stepmania/src/ScreenSelectProfile.h index 67096c4bc1..762b3dc37b 100644 --- a/stepmania/src/ScreenSelectProfile.h +++ b/stepmania/src/ScreenSelectProfile.h @@ -1,7 +1,7 @@ -/* ScreenEnding - Ending screen that shows stats. */ +/* ScreenSelectProfile - Screen that allows to select and load profile to use. */ -#ifndef SCREEN_Select_PROFILE_H -#define SCREEN_Select_PROFILE_H +#ifndef SCREEN_SELECT_PROFILE_H +#define SCREEN_SELECT_PROFILE_H #include "ScreenWithMenuElements.h" @@ -24,7 +24,7 @@ private: #endif /* -* (c) 2004 Chris Danford +* (c) 2007 vdl * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a