From 5cf9f4faeba21113a8e976c318dc9b3b3ba39d8e Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Wed, 22 Jan 2020 18:27:32 +1100 Subject: [PATCH] Incorrect joystick id was returned on an inactive ARVR controller --- scene/3d/arvr_nodes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index 82293268b92..f0aaba1065b 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -295,7 +295,8 @@ int ARVRController::get_joystick_id() const { ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); if (tracker == NULL) { - return 0; + // No tracker? no joystick id... (0 is our first joystick) + return -1; }; return tracker->get_joy_id();