fix 'Load player edits, play one of the player edits, continue, choose Nontop; crash'
This commit is contained in:
@@ -15,14 +15,24 @@ void ScreenContinue::BeginScreen()
|
|||||||
{
|
{
|
||||||
GAMESTATE->SetCurrentStyle( NULL );
|
GAMESTATE->SetCurrentStyle( NULL );
|
||||||
|
|
||||||
// unjoin all players with 0 stages left
|
// Unjoin human players with 0 stages left and reset non-human players.
|
||||||
FOREACH_HumanPlayer( p )
|
// We need to reset non-human players because data in non-human (CPU)
|
||||||
|
// players will be filled, and there may be stale pointers to things like
|
||||||
|
// edit Steps.
|
||||||
|
FOREACH_ENUM( PlayerNumber, p )
|
||||||
{
|
{
|
||||||
bool bPlayerDone = GAMESTATE->m_iPlayerStageTokens[p] <= 0;
|
if( GAMESTATE->IsHumanPlayer(p) )
|
||||||
if( bPlayerDone )
|
|
||||||
{
|
{
|
||||||
GAMESTATE->UnjoinPlayer( p );
|
bool bPlayerDone = GAMESTATE->m_iPlayerStageTokens[p] <= 0;
|
||||||
MEMCARDMAN->UnlockCard( p );
|
if( bPlayerDone )
|
||||||
|
{
|
||||||
|
GAMESTATE->UnjoinPlayer( p );
|
||||||
|
MEMCARDMAN->UnlockCard( p );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GAMESTATE->ResetPlayer( p );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user