Skip to content

Commit

Permalink
Reset touching_ground when in free_move
Browse files Browse the repository at this point in the history
This corrects local player animation after enabling fly while standing on ground.
  • Loading branch information
sfan5 committed Jun 7, 2020
1 parent 09f9e46 commit 0ab5808
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client/localplayer.cpp
Expand Up @@ -200,6 +200,8 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
if (noclip && free_move) {
position += m_speed * dtime;
setPosition(position);

touching_ground = false;
added_velocity = v3f(0.0f); // ignored
return;
}
Expand Down Expand Up @@ -787,6 +789,8 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
if (free_move) {
position += m_speed * dtime;
setPosition(position);

touching_ground = false;
m_sneak_node_exists = false;
added_velocity = v3f(0.0f);
return;
Expand Down

0 comments on commit 0ab5808

Please sign in to comment.