From f89f9f00944d35aad9d2ddb22060bd4dc3c19102 Mon Sep 17 00:00:00 2001 From: George Marques Date: Mon, 7 Aug 2017 00:07:19 -0300 Subject: [PATCH] UWP: Fix Gamepad removal logic Fix #9209 --- platform/uwp/joypad_uwp.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp index 34e36f7b665..9495002675a 100644 --- a/platform/uwp/joypad_uwp.cpp +++ b/platform/uwp/joypad_uwp.cpp @@ -122,15 +122,7 @@ void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Inp ERR_FAIL_COND(idx == -1); - for (int i = idx + 1; i < MAX_CONTROLLERS - 1; i++) { - - if (!controllers[i].connected) { - break; - } - - controllers[i - 1] = controllers[i]; - } - controllers[MAX_CONTROLLERS - 1] = ControllerDevice(); + controllers[idx] = ControllerDevice(); input->joy_connection_changed(idx, false, "Xbox Controller"); }