allow to continue if local profile count is less than human player count
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user