Fix: Don't crash if we have not yet selected a style.

This commit is contained in:
Charles Lohr
2005-01-25 06:20:48 +00:00
parent 957e89466a
commit e9880a7f7c
+5 -1
View File
@@ -94,7 +94,11 @@ void ScreenPrompt::Input( const DeviceInput& DeviceI, const InputEventType type,
if( DeviceI.device==DEVICE_KEYBOARD && type==IET_FIRST_PRESS )
{
PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller );
PlayerNumber pn;
if ( GAMESTATE->GetCurrentStyle() == NULL )
pn = (PlayerNumber)GameI.controller;
else
pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller );
switch( DeviceI.button )
{
case KEY_LEFT: