Skip to content

Commit 6689f03

Browse files
committed
use active rotation for movement calculations as server rotation is outdated
1 parent 40ba329 commit 6689f03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

common/src/main/kotlin/com/lambda/interaction/request/rotation/RotationManager.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ object RotationManager : RequestHandler<RotationRequest>(
186186
val movementYaw: Float?
187187
get() {
188188
if (activeRequest?.mode == RotationMode.Silent) return null
189-
return serverRotation.yaw.toFloat()
189+
return activeRotation.yaw.toFloat()
190190
}
191191

192192
@JvmStatic
193193
val movementPitch: Float?
194194
get() {
195195
if (activeRequest?.mode == RotationMode.Silent) return null
196-
return serverRotation.pitch.toFloat()
196+
return activeRotation.pitch.toFloat()
197197
}
198198

199199
@JvmStatic
@@ -244,7 +244,7 @@ object RotationManager : RequestHandler<RotationRequest>(
244244
if (signForward == 0f && signStrafe == 0f) return@runSafe
245245

246246
// Actual yaw used by the physics engine
247-
var actualYaw = serverRotation.yaw
247+
var actualYaw = activeRotation.yaw
248248

249249
if (activeRequest?.mode == RotationMode.Silent) {
250250
actualYaw = player.yaw.toDouble()
@@ -272,7 +272,7 @@ object RotationManager : RequestHandler<RotationRequest>(
272272
// Makes baritone movement safe
273273
// when yaw difference is too big to compensate it by modifying keyboard input
274274
val minYawDist = movementYawList
275-
.map { serverRotation.yaw + it } // all possible movement directions (including diagonals)
275+
.map { activeRotation.yaw + it } // all possible movement directions (including diagonals)
276276
.minOf { Rotation.angleDifference(it, baritoneYaw) }
277277

278278
if (minYawDist > 5.0) {

0 commit comments

Comments
 (0)