Fix CODE_CANCEL_ALL_PLAYER_OPTIONS not working when the

last input isn't a style button (StyleI.player isn't valid in that case).

StyleI is tied to "columns"; it's only used in screens that deal with columns:
gameplay, editor, name entry.  Maybe we can derive it on demand in these
functions and not pass it around to dozens of functions that don't use it ...
This commit is contained in:
Glenn Maynard
2004-12-04 11:05:38 +00:00
parent 005a7f5efa
commit 29c5e8a9e1
+3 -3
View File
@@ -10,6 +10,7 @@
#include "PrefsManager.h"
#include "CodeDetector.h"
#include "ScreenDimensions.h"
#include "Style.h"
#define PREV_SCREEN THEME->GetMetric ("ScreenPlayerOptions","PrevScreen")
@@ -111,9 +112,8 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp
}
}
PlayerNumber pn = StyleI.player;
if( GAMESTATE->IsHumanPlayer(StyleI.player) && CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL_PLAYER_OPTIONS) )
PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller );
if( GAMESTATE->IsHumanPlayer(pn) && CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL_PLAYER_OPTIONS) )
{
SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions cancel all") );