summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-22 08:48:28 +0100
committerGitHub <noreply@github.com>2020-01-22 08:48:28 +0100
commit7e76a67d1e6d8814622ac0eb6f40d659f25dce6e (patch)
treec52a8933a28ac478a312cba17523208ac42b7a3a
parenteefeff23e9ff80fbbb134a8f2ea7cd8a4b76de46 (diff)
parent5cf9f4faeba21113a8e976c318dc9b3b3ba39d8e (diff)
Merge pull request #35430 from BastiaanOlij/fix_vr_joystick_id
Incorrect joystick id was returned on an inactive ARVR controller
-rw-r--r--scene/3d/arvr_nodes.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp
index 82293268b9..f0aaba1065 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();