mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-21 09:31:20 -08:00
Change getTrackerById
This commit is contained in:
1 parent
9205f6cab7
commit
f72045438e
1 file changed
+5
-3
@@ -309,9 +309,11 @@ public class VRServer extends Thread {
|
||||
for (Tracker tracker : trackers) {
|
||||
if (tracker.getTrackerNum() != id.getTrackerNum())
|
||||
continue;
|
||||
if (tracker.getDevice() == null && id.getDeviceId() != null)
|
||||
continue;
|
||||
if (tracker.getDevice() != null && id.getDeviceId() == null)
|
||||
// A tracker id is a combination of two data, the device id (optional) and the tracker num
|
||||
// tracker.getDevice() can be null for synthetic trackers
|
||||
// if device id is null but the tracker id has a device id, the tracker should be skipped
|
||||
// On the other hand if the tracker has a device id but the TrackerId does not have one we should also skip
|
||||
if (tracker.getDevice() == null ^ id.getDeviceId() == null)
|
||||
continue;
|
||||
if (tracker.getDevice().getId() != id.getDeviceId().getId())
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user