Skip to content

Commit c3fb9ce

Browse files
chore: readd clamping
1 parent a7bab22 commit c3fb9ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/plugins/physics.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ function inject (bot, { physicsEnabled, maxCatchupTicks }) {
187187
const maxDeltaYaw = PHYSICS_TIMESTEP * physics.yawSpeed
188188
const maxDeltaPitch = PHYSICS_TIMESTEP * physics.pitchSpeed
189189

190-
lastSentYaw += dYaw
191-
lastSentPitch += dPitch
190+
lastSentYaw += math.clamp(-maxDeltaYaw, dYaw, maxDeltaYaw)
191+
lastSentPitch += math.clamp(-maxDeltaPitch, dPitch, maxDeltaPitch)
192192

193193
lastSentPitch = math.clamp(-PI/2, lastSentPitch, PI/2)
194194

0 commit comments

Comments
 (0)