diff --git a/src/main/kotlin/com/lambda/module/modules/movement/Pitch40.kt b/src/main/kotlin/com/lambda/module/modules/movement/Pitch40.kt index 1e4c43de4..95fd84617 100644 --- a/src/main/kotlin/com/lambda/module/modules/movement/Pitch40.kt +++ b/src/main/kotlin/com/lambda/module/modules/movement/Pitch40.kt @@ -57,6 +57,11 @@ object Pitch40 : Module( } listen { + if (!player.isGliding) { + reset(player) + return@listen + } + when (state) { Pitch40State.GainSpeed -> { lookAt(Rotation(player.yaw, PITCH_DOWN_DEFAULT)).requestBy(this@Pitch40) @@ -87,12 +92,16 @@ object Pitch40 : Module( } onEnable { - state = Pitch40State.GainSpeed - lastPos = player.pos - lastAngle = PITCH_UP_DEFAULT + reset(player) } } + fun reset(player: ClientPlayerEntity) { + state = Pitch40State.GainSpeed + lastPos = player.pos + lastAngle = PITCH_UP_DEFAULT + } + /** * Get the player's current speed in meters per second. */