Simplify mounting reset status checking (#1382)

This commit is contained in:
Butterscotch! authored and GitHub committed 2025-04-15 19:18:47 +02:00
1 parent 00690dc351
commit bf9a7fe7f4
1 file changed
+8 -3
@@ -29,7 +29,6 @@ import io.github.axisangles.ktmath.Vector3
import io.github.axisangles.ktmath.Vector3.Companion.NEG_Y
import io.github.axisangles.ktmath.Vector3.Companion.NULL
import io.github.axisangles.ktmath.Vector3.Companion.POS_Y
import solarxr_protocol.rpc.StatusData
import java.lang.IllegalArgumentException
import kotlin.properties.Delegates
@@ -1599,8 +1598,14 @@ class HumanSkeleton(
@VRServerThread
fun resetTrackersMounting(resetSourceName: String?) {
val server = humanPoseManager.server
if (server != null && server.statusSystem.hasStatusType(StatusData.StatusTrackerReset)) {
val trackersToReset = trackersToReset
// TODO: PLEASE rewrite this handling at some point in the future... This is so
// hacky!! Surely there's a better way to check reset status - Butterscotch
// If there's a server present (required for status) and any tracker reports a
// non-zero reset status (indicates reset required), then block mounting reset,
// as it requires a full reset first
if (humanPoseManager.server != null && trackersToReset.any { it != null && it.lastResetStatus != 0u }) {
LogManager.info("[HumanSkeleton] Reset: mounting ($resetSourceName) failed, reset required")
return
}