Merge pull request #35430 from BastiaanOlij/fix_vr_joystick_id

Incorrect joystick id was returned on an inactive ARVR controller
This commit is contained in:
Rémi Verschelde 2020-01-22 08:48:28 +01:00 committed by GitHub
commit 7e76a67d1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,7 +295,8 @@ int ARVRController::get_joystick_id() const {
ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
if (tracker == NULL) { if (tracker == NULL) {
return 0; // No tracker? no joystick id... (0 is our first joystick)
return -1;
}; };
return tracker->get_joy_id(); return tracker->get_joy_id();