Skip to content

Commit

Permalink
Fixed Xinput hooks (oops!)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilyaki committed Aug 21, 2021
1 parent 2b90b66 commit 22cf645
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ProtoInput/ProtoInputHooks/XinputHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ inline std::pair<bool, unsigned int> GetTargetControllerIndex(DWORD dwUserIndex)
{
// XinputHook::controllerIndex 0 means user wants no controller on this game
if (dwUserIndex == 0 || dwUserIndex == XUSER_INDEX_ANY)
return { XinputHook::controllerIndex == 0, XinputHook::controllerIndex - 1 };
return { XinputHook::controllerIndex != 0, XinputHook::controllerIndex - 1 };

if (dwUserIndex == 1)
return { XinputHook::controllerIndex2 == 0, XinputHook::controllerIndex2 - 1 };
return { XinputHook::controllerIndex2 != 0, XinputHook::controllerIndex2 - 1 };

if (dwUserIndex == 2)
return { XinputHook::controllerIndex3 == 0, XinputHook::controllerIndex3 - 1 };
return { XinputHook::controllerIndex3 != 0, XinputHook::controllerIndex3 - 1 };

if (dwUserIndex == 3)
return { XinputHook::controllerIndex4 == 0, XinputHook::controllerIndex4 - 1 };
return { XinputHook::controllerIndex4 != 0, XinputHook::controllerIndex4 - 1 };

return { false, 0 };
}
Expand Down

0 comments on commit 22cf645

Please sign in to comment.