Skip to content

Commit 1ec300d

Browse files
committed
simplified rotation logic for place and break managers
1 parent 70be96e commit 1ec300d

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakManager.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,7 @@ object BreakManager : RequestHandler<BreakRequest>() {
169169
}
170170

171171
onRotatePost {
172-
validRotation = breakingInfos
173-
.filterNotNull()
174-
.firstOrNull()
175-
?.let { info ->
176-
!info.breakConfig.rotateForBreak || rotation?.done == true
177-
} ?: true
178-
172+
validRotation = rotation?.done ?: true
179173
postEvent()
180174
}
181175

common/src/main/kotlin/com/lambda/interaction/request/placing/PlaceManager.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ object PlaceManager : RequestHandler<PlaceRequest>() {
9999

100100
activeThisTick = true
101101

102-
if (request.buildConfig.placeSettings.rotateForPlace) {
103-
rotation = request.rotationConfig.request(request.placeContext.rotation)
104-
}
102+
rotation = if (request.buildConfig.placeSettings.rotateForPlace)
103+
request.rotationConfig.request(request.placeContext.rotation)
104+
else null
105105

106106
pendingInteractions.setMaxSize(request.buildConfig.maxPendingInteractions)
107107
pendingInteractions.setDecayTime(request.buildConfig.interactionTimeout * 50L)
108108
}
109109
}
110110

111111
onRotatePost {
112-
validRotation = rotation?.done == true
112+
validRotation = rotation?.done ?: true
113113
postEvent()
114114
}
115115

0 commit comments

Comments
 (0)