Skip to content

Commit

Permalink
Fix status not working (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eirenliel committed Jul 4, 2023
2 parents 055fd78 + af2cf10 commit 7f11534
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class Tracker @JvmOverloads constructor(
var statusResetRecently = false
private var alreadyInitialized = false
var status: TrackerStatus by Delegates.observable(TrackerStatus.DISCONNECTED) {
_, _, new ->
_, old, new ->
if (old == new) return@observable

if (!new.reset) {
if (alreadyInitialized) {
statusResetRecently = true
Expand All @@ -82,7 +84,9 @@ class Tracker @JvmOverloads constructor(
}

var trackerPosition: TrackerPosition? by Delegates.observable(trackerPosition) {
_, _, _ ->
_, old, new ->
if (old == new) return@observable

if (!isInternal) {
checkReportRequireReset()
}
Expand Down Expand Up @@ -199,7 +203,9 @@ class Tracker @JvmOverloads constructor(
resetsHandler.allowDriftCompensation = it
}
}
if (!isInternal && !(!isImu() && (trackerPosition == TrackerPosition.LEFT_HAND || trackerPosition == TrackerPosition.RIGHT_HAND))) {
if (!isInternal &&
!(!isImu() && (trackerPosition == TrackerPosition.LEFT_HAND || trackerPosition == TrackerPosition.RIGHT_HAND))
) {
checkReportRequireReset()
}
}
Expand Down

0 comments on commit 7f11534

Please sign in to comment.