aboutsummaryrefslogtreecommitdiff
path: root/src/hid_core/frontend/emulated_controller.h
diff options
context:
space:
mode:
authorMaranBr <maranbr@outlook.com>2025-10-16 03:14:39 +0200
committercrueter <crueter@eden-emu.dev>2025-10-16 03:14:39 +0200
commitbb836ed6c28d608b3cf9da4116bb6f9a2fb6f273 (patch)
treeaea18360e9f78cda6965668662113c87f9f33940 /src/hid_core/frontend/emulated_controller.h
parentf273ac446bb4d0badc8c3ac949fe0ed3534eb034 (diff)
[hid_core] Fix a crash related to setting controls while the game is running (#2747)
This fixes a crash related to setting controls while the game is running. Fixes BOTW, TOTK, MK8D and possibly others as well. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2747 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: MaranBr <maranbr@outlook.com> Co-committed-by: MaranBr <maranbr@outlook.com>
Diffstat (limited to 'src/hid_core/frontend/emulated_controller.h')
-rw-r--r--src/hid_core/frontend/emulated_controller.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h
index 677b363157..8e8293ff36 100644
--- a/src/hid_core/frontend/emulated_controller.h
+++ b/src/hid_core/frontend/emulated_controller.h
@@ -20,6 +20,7 @@
#include "common/settings.h"
#include "common/vector_math.h"
#include "hid_core/frontend/motion_input.h"
+#include "hid_core/hid_core.h"
#include "hid_core/hid_types.h"
#include "hid_core/irsensor/irs_types.h"
@@ -588,6 +589,7 @@ private:
std::array<VibrationValue, 2> last_vibration_value{DEFAULT_VIBRATION_VALUE,
DEFAULT_VIBRATION_VALUE};
std::array<std::chrono::steady_clock::time_point, 2> last_vibration_timepoint{};
+ std::array<bool, HIDCore::available_controllers - 2> controller_connected{};
// Temporary values to avoid doing changes while the controller is in configuring mode
NpadStyleIndex tmp_npad_type{NpadStyleIndex::None};