Fix keyboard segfault

This commit is contained in:
def 2015-08-28 18:16:16 +02:00
parent 10d6f69d32
commit 8e3550f9c6

View file

@ -177,8 +177,8 @@ int CInput::Update()
AddEvent(Code, 0, 0); AddEvent(Code, 0, 0);
} }
break;
} }
// handle keys // handle keys
case SDL_KEYDOWN: case SDL_KEYDOWN:
if(Event.key.keysym.sym == KEY_UNKNOWN) if(Event.key.keysym.sym == KEY_UNKNOWN)
@ -234,7 +234,7 @@ int CInput::Update()
} }
// //
if(Key != -1) if(Key >= 0 && Key < 1024)
{ {
m_aInputCount[m_InputCurrent][Key].m_Presses++; m_aInputCount[m_InputCurrent][Key].m_Presses++;
if(Action == IInput::FLAG_PRESS) if(Action == IInput::FLAG_PRESS)