mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Assert instead of returning empty event on invalid index
This commit is contained in:
parent
cdd19beee4
commit
8b26fa0bc3
|
@ -58,11 +58,7 @@ public:
|
||||||
virtual bool IsEventValid(CEvent *pEvent) const = 0;
|
virtual bool IsEventValid(CEvent *pEvent) const = 0;
|
||||||
CEvent GetEvent(int Index) const
|
CEvent GetEvent(int Index) const
|
||||||
{
|
{
|
||||||
if(Index < 0 || Index >= m_NumEvents)
|
dbg_assert(Index >= 0 && Index < m_NumEvents, "Index invalid");
|
||||||
{
|
|
||||||
IInput::CEvent e = {0, 0};
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
return m_aInputEvents[Index];
|
return m_aInputEvents[Index];
|
||||||
}
|
}
|
||||||
CEvent *GetEventsRaw() { return m_aInputEvents; }
|
CEvent *GetEventsRaw() { return m_aInputEvents; }
|
||||||
|
|
Loading…
Reference in a new issue