mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 16:21:52 +01:00
Validate NpadId for ActivateVibrationDevice
This commit is contained in:
parent
4bdd033354
commit
ebcbc5b05b
@ -83,7 +83,7 @@ namespace skyline::input {
|
|||||||
/**
|
/**
|
||||||
* @brief Checks if the NpadId is valid
|
* @brief Checks if the NpadId is valid
|
||||||
*/
|
*/
|
||||||
bool IsNpadIdValid(NpadId id) {
|
static bool IsNpadIdValid(NpadId id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case NpadId::Player1:
|
case NpadId::Player1:
|
||||||
case NpadId::Player2:
|
case NpadId::Player2:
|
||||||
|
@ -12,8 +12,9 @@ namespace skyline::service::hid {
|
|||||||
Result IActiveVibrationDeviceList::ActivateVibrationDevice(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
Result IActiveVibrationDeviceList::ActivateVibrationDevice(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
|
||||||
auto handle{request.Pop<NpadDeviceHandle>()};
|
auto handle{request.Pop<NpadDeviceHandle>()};
|
||||||
|
|
||||||
if (!handle.isRight)
|
if (NpadManager::IsNpadIdValid(handle.id))
|
||||||
state.input->npad.at(handle.id).vibrationRight = NpadVibrationValue{};
|
if (!handle.isRight)
|
||||||
|
state.input->npad.at(handle.id).vibrationRight = NpadVibrationValue{};
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user