Skip to content

Commit

Permalink
Set player speed to 0 when overridden speed is 0
Browse files Browse the repository at this point in the history
Fixes luanti-org#10037. Why the overridden speed is used as a coefficient to
calculate acceleration?
  • Loading branch information
matteobin committed Sep 12, 2023
1 parent 833c324 commit a0c752e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/localplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
setPitch(control.pitch);
setYaw(control.yaw);

// Nullify speed and don't run positioning code if the player is attached
if (getParent()) {
// Nullify speed and don't run positioning code if the player is attached or if the overridden speed is 0
if (getParent() || physics_override.speed == 0) {
setSpeed(v3f(0.0f));
return;
}
Expand Down

0 comments on commit a0c752e

Please sign in to comment.