Fix crash in online mode by not changing the difficulty for P2 when P2 isn't playing.

This commit is contained in:
Kyzentun Keeslala
2016-06-30 13:11:13 -06:00
parent 2a2007b9c8
commit a9a1b82d8c
+16 -3
View File
@@ -337,10 +337,23 @@ bool ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
/* Why? Nothing else allows that. (-who?) */
// I agree, that's a stupid idea -aj
// Funny story: If the arrow keys are mapped to Player 2, but the person
// is playing as Player 1, then hitting down to change the difficulty will
// crash in UpdateDifficulties. So pretend the input came from the player
// that is enabled. -Kyz
PlayerNumber pn = input.pn;
if( GAMESTATE->IsPlayerEnabled( PLAYER_2 ) &&
!GAMESTATE->IsPlayerEnabled( PLAYER_1 ) )
pn = PLAYER_2;
if(!GAMESTATE->IsPlayerEnabled(pn))
{
if(pn == PLAYER_1)
{
pn= PLAYER_2;
}
else
{
pn= PLAYER_1;
}
}
if( GAMESTATE->m_pCurSong == NULL )
return false;