Skip to content

Commit

Permalink
player/player.go: Fixed stopping sneaking leading to a death spiral o…
Browse files Browse the repository at this point in the history
…f 0 speed.
  • Loading branch information
Sandertv committed Nov 23, 2024
1 parent 28b3967 commit c7cf0fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ func (p *Player) StartSprinting() {
}
p.StopSneaking()
p.sprinting = true
p.SetSpeed(p.Speed() * 1.3)
p.SetSpeed(p.speed * 1.3)
p.updateState()
}

Expand All @@ -948,8 +948,8 @@ func (p *Player) StopSprinting() {
if p.Handler().HandleToggleSprint(ctx, false); ctx.Cancelled() {
return
}
p.sprinting = true
p.SetSpeed(p.Speed() / 1.3)
p.sprinting = false
p.SetSpeed(p.speed / 1.3)
p.updateState()
}

Expand Down

0 comments on commit c7cf0fa

Please sign in to comment.