mirror of
https://github.com/Maschell/SDL2_Playground.git
synced 2024-11-27 07:04:16 +01:00
Block accessing non-valid controllers
This commit is contained in:
parent
dfe2438574
commit
94f5e90638
@ -85,7 +85,7 @@ void ControllerManager::processEvent(SDL_JoystickID joystickId, int32_t channel,
|
||||
channel = joystickToChannel[joystickId];
|
||||
}
|
||||
}
|
||||
if (channel != -1) {
|
||||
if (channel != -1 && controllerList.contains(static_cast<const GuiTrigger::eChannels>(channel))) {
|
||||
controllerList[static_cast<GuiTrigger::eChannels>(channel)]->update(e, screenWidth, screenHeight);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user