Merge pull request #12 from PiMaker/pi-falls-back-to-exclude-serial-for-hmd

fall back to serial-excluded matching for HMD finding
This commit is contained in:
Hyblocker authored and GitHub committed 2024-07-14 17:32:45 +02:00
commit ceeab0e6e2
1 file changed
+7
+7
View File
@@ -97,5 +97,12 @@ int VRState::FindDevice(const std::string& trackingSystem, const std::string& mo
if (device.trackingSystem == trackingSystem && device.model == model && device.serial == serial) return device.id;
}
// allow fallback excluding serial for HMD specifically
for (int i = 0; i < devices.size(); i++) {
const auto& device = devices[i];
if (device.trackingSystem == trackingSystem && device.model == model && device.deviceClass == vr::TrackedDeviceClass::TrackedDeviceClass_HMD) return device.id;
}
return -1;
}