Assert instead of returning empty event on invalid index

This commit is contained in:
Robert Müller 2023-04-21 18:29:31 +02:00
parent cdd19beee4
commit 8b26fa0bc3

View file

@ -58,11 +58,7 @@ public:
virtual bool IsEventValid(CEvent *pEvent) const = 0;
CEvent GetEvent(int Index) const
{
if(Index < 0 || Index >= m_NumEvents)
{
IInput::CEvent e = {0, 0};
return e;
}
dbg_assert(Index >= 0 && Index < m_NumEvents, "Index invalid");
return m_aInputEvents[Index];
}
CEvent *GetEventsRaw() { return m_aInputEvents; }