3
0
Fork 0
forked from suyu/suyu

npad: Use NPadIdToIndex to prevent invalid array access

This commit is contained in:
Zach Hilman 2018-11-28 09:01:58 -05:00
parent 1856d0ee8a
commit 299224790c

View file

@ -575,8 +575,8 @@ void Controller_NPad::AddNewControllerAt(NPadControllerType controller, u32 npad
return; return;
} }
connected_controllers[npad_id] = {controller, true}; connected_controllers[NPadIdToIndex(npad_id)] = {controller, true};
InitNewlyAddedControler(npad_id); InitNewlyAddedControler(NPadIdToIndex(npad_id));
} }
void Controller_NPad::ConnectNPad(u32 npad_id) { void Controller_NPad::ConnectNPad(u32 npad_id) {