]> git.lizzy.rs Git - minetest.git/commitdiff
Rename a variable in localplayer.h, resolves a TODO
authorDS <vorunbekannt75@web.de>
Tue, 20 Sep 2022 08:55:11 +0000 (10:55 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Sep 2022 08:55:11 +0000 (10:55 +0200)
src/client/localplayer.cpp
src/client/localplayer.h

index 648a886427bf0ec9228204edd3c865ca59d6ce93..14be3321b6a8118e79eaa93c7f9656a7223d99e0 100644 (file)
@@ -186,7 +186,7 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
        // Copy parent position if local player is attached
        if (getParent()) {
                setPosition(m_cao->getPosition());
-               added_velocity = v3f(0.0f); // ignored
+               m_added_velocity = v3f(0.0f); // ignored
                return;
        }
 
@@ -202,12 +202,12 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
                setPosition(position);
 
                touching_ground = false;
-               added_velocity = v3f(0.0f); // ignored
+               m_added_velocity = v3f(0.0f); // ignored
                return;
        }
 
-       m_speed += added_velocity;
-       added_velocity = v3f(0.0f);
+       m_speed += m_added_velocity;
+       m_added_velocity = v3f(0.0f);
 
        /*
                Collision detection
@@ -755,7 +755,7 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
        if (getParent()) {
                setPosition(m_cao->getPosition());
                m_sneak_node_exists = false;
-               added_velocity = v3f(0.0f);
+               m_added_velocity = v3f(0.0f);
                return;
        }
 
@@ -771,12 +771,12 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
 
                touching_ground = false;
                m_sneak_node_exists = false;
-               added_velocity = v3f(0.0f);
+               m_added_velocity = v3f(0.0f);
                return;
        }
 
-       m_speed += added_velocity;
-       added_velocity = v3f(0.0f);
+       m_speed += m_added_velocity;
+       m_added_velocity = v3f(0.0f);
 
        /*
                Collision detection
index 83ad3d1d37a2cf001f55eec76538fea329979523..a2fe1766d3676fa13a50b7d5a75729536f76f6ef 100644 (file)
@@ -148,7 +148,7 @@ class LocalPlayer : public Player
 
        inline void addVelocity(const v3f &vel)
        {
-               added_velocity += vel;
+               m_added_velocity += vel;
        }
 
        inline Lighting& getLighting() { return m_lighting; }
@@ -198,8 +198,7 @@ class LocalPlayer : public Player
        bool m_autojump = false;
        float m_autojump_time = 0.0f;
 
-       v3f added_velocity = v3f(0.0f); // cleared on each move()
-       // TODO: Rename to adhere to convention: added_velocity --> m_added_velocity
+       v3f m_added_velocity = v3f(0.0f); // in BS-space; cleared on each move()
 
        GenericCAO *m_cao = nullptr;
        Client *m_client;