allow to continue if local profile count is less than human player count

This commit is contained in:
Vecais Dumais Laacis
2007-09-24 21:49:12 +00:00
parent 9e6be5b399
commit 1fa16a9aa9
2 changed files with 17 additions and 6 deletions
+13 -2
View File
@@ -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
+4 -4
View File
@@ -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