Fix tap reset enable toggle not working

This commit is contained in:
Sapphire committed 2026-10-28 19:51:17 -05:00
1 parent 02df411819
commit aa1343b49c
2 files changed
+6 -6

No files matched your search

@@ -44,17 +44,17 @@ class TapDetectionBasicBehaviour : TapDetectionBehaviour {
// setupMode uses defaults
if (!tapDetectionState.setupMode) {
when (trackerState.bodyPart) {
tapDetectionState.yawResetBodyPart -> {
tapDetectionState.yawResetBodyPart if tapDetectionConfig.yawResetEnabled -> {
trackerTapDetectionState.performsReset = true
trackerTapDetectionState.tapsNeeded = tapDetectionConfig.yawResetTaps
}
tapDetectionState.fullResetBodyPart -> {
tapDetectionState.fullResetBodyPart if tapDetectionConfig.fullResetEnabled -> {
trackerTapDetectionState.performsReset = true
trackerTapDetectionState.tapsNeeded = tapDetectionConfig.fullResetTaps
}
tapDetectionState.mountingResetBodyPart -> {
tapDetectionState.mountingResetBodyPart if tapDetectionConfig.mountingResetEnabled -> {
trackerTapDetectionState.performsReset = true
trackerTapDetectionState.tapsNeeded = tapDetectionConfig.mountingResetTaps
}
@@ -48,9 +48,9 @@ class TapDetectionManager(val context: TapDetectionContext, val server: VRServer
val bodyPart = tracker.context.state.value.bodyPart ?: return
val tapDetectionConfig = settings.context.state.value.data.tapDetectionConfig
val (resetType, actionDelay) = when (bodyPart) {
state.yawResetBodyPart -> ResetType.YAW to tapDetectionConfig.yawResetDelay
state.fullResetBodyPart -> ResetType.FULL to tapDetectionConfig.fullResetDelay
state.mountingResetBodyPart -> ResetType.MOUNTING to tapDetectionConfig.mountingResetDelay
state.yawResetBodyPart if tapDetectionConfig.yawResetEnabled -> ResetType.YAW to tapDetectionConfig.yawResetDelay
state.fullResetBodyPart if tapDetectionConfig.fullResetEnabled -> ResetType.FULL to tapDetectionConfig.fullResetDelay
state.mountingResetBodyPart if tapDetectionConfig.mountingResetEnabled -> ResetType.MOUNTING to tapDetectionConfig.mountingResetDelay
else -> return
}