From c5a8fec289146a7a7fb49c0c42f20695ec37e090 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 15 Nov 2019 18:44:59 +0000 Subject: [PATCH] Clean-up Input.cpp --- src/Input.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Input.cpp b/src/Input.cpp index b27c063b..a0afce3e 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -114,7 +114,7 @@ BOOL __stdcall EnumDevices_Callback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) static int already_ran; static DirectInputPair *directinput_objects; - if ((already_ran & 1) == 0) + if (!(already_ran & 1)) { already_ran |= 1; directinput_objects = (DirectInputPair*)pvRef; @@ -166,7 +166,7 @@ BOOL GetJoystickStatus(JOYSTICK_STATUS *status) return FALSE; HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate); - if (res) + if (res != DI_OK) { if (res == DIERR_INPUTLOST) SetDeviceAquire(FALSE); @@ -211,7 +211,7 @@ BOOL ResetJoystickStatus(void) return FALSE; HRESULT res = joystick->GetDeviceState(sizeof(DIJOYSTATE), &joystate); - if (res) + if (res != DI_OK) { if (res == DIERR_INPUTLOST) SetDeviceAquire(FALSE);