From 36291ebf363fce982d319e3eca807b1a48143e96 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 29 Aug 2019 19:36:39 +0100 Subject: [PATCH] Cleanup Doesn't affect the generated ASM --- src/Input.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Input.cpp b/src/Input.cpp index 275fdc92..656d8853 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -92,18 +92,14 @@ BOOL HookAllDirectInputDevices(HWND hWnd) joystick = directinput_objects.device; if (joystick->SetDataFormat(&c_dfDIJoystick) != DI_OK) // c_dfDIJoystick might be incorrect - { return FALSE; - } - else if (joystick->SetCooperativeLevel(hWnd, DISCL_EXCLUSIVE | DISCL_BACKGROUND) != DI_OK) - { + + if (joystick->SetCooperativeLevel(hWnd, DISCL_EXCLUSIVE | DISCL_BACKGROUND) != DI_OK) return FALSE; - } - else - { - joystick->Acquire(); - return TRUE; - } + + joystick->Acquire(); + + return TRUE; } // The original name for this function is unknown