From f6084e398e1be42458d101f594355612349bdd37 Mon Sep 17 00:00:00 2001 From: Erimel Date: Tue, 1 Sep 2026 17:20:01 -0400 Subject: [PATCH] Fix automatic routing when no tracker is connected --- server/core/src/main/java/dev/slimevr/routing/behaviours.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/core/src/main/java/dev/slimevr/routing/behaviours.kt b/server/core/src/main/java/dev/slimevr/routing/behaviours.kt index 704459d69..7a2ba69bb 100644 --- a/server/core/src/main/java/dev/slimevr/routing/behaviours.kt +++ b/server/core/src/main/java/dev/slimevr/routing/behaviours.kt @@ -6,6 +6,7 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.flatMapLatest +import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach @@ -36,6 +37,8 @@ class BoneRoutingBasicBehaviour(private val appContext: AppContextProvider) : Bo server.context.state .map { it.trackers.values } .flatMapLatest { trackers -> + if (trackers.isEmpty()) return@flatMapLatest flowOf(emptySet()) + // Tracker state emits on every rotation packet, but only bodyPart/status matter here. // Dedup per tracker first, or combine gets resumed once per packet per tracker. combine(