mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 17:44:18 +00:00
Fix keyboard segfault
This commit is contained in:
parent
10d6f69d32
commit
8e3550f9c6
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue