From f88651965dae6a4503f987353b81b5f9ec95bc77 Mon Sep 17 00:00:00 2001 From: acdemiralp <demiralpali@gmail.com> Date: Thu, 20 Dec 2018 00:11:52 +0100 Subject: [PATCH] Initializing value/pressed/released to avoid release bugs. --- .../DisplayClusterInput/Private/DisplayClusterInputDevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/DisplayClusterInput/Private/DisplayClusterInputDevice.cpp b/Source/DisplayClusterInput/Private/DisplayClusterInputDevice.cpp index 9eff51a..75c860e 100644 --- a/Source/DisplayClusterInput/Private/DisplayClusterInputDevice.cpp +++ b/Source/DisplayClusterInput/Private/DisplayClusterInputDevice.cpp @@ -70,7 +70,7 @@ void FDisplayClusterInputDevice::SendControllerEvents() { for (auto j = 0; j < AxisIndices.Num(); ++j) { - float Value; + float Value = 0.0f; InputManager->GetAxis(AxisDeviceIds[i], j, Value); if (Value != 0.0f) MessageHandler->OnControllerAnalog(AxisIndices[j]->GetFName(), i, Value); } @@ -82,7 +82,7 @@ void FDisplayClusterInputDevice::SendControllerEvents() { for (auto j = 0; j < ButtonIndices.Num(); ++j) { - bool Pressed, Released; + bool Pressed = false, Released = false; InputManager->WasButtonPressed (ButtonDeviceIds[i], j, Pressed ); InputManager->WasButtonReleased(ButtonDeviceIds[i], j, Released); if (Pressed ) MessageHandler->OnControllerButtonPressed (ButtonIndices[j]->GetFName(), i, false); -- GitLab