forked from Mirrorlandia_minetest/minetest
LocalPlayer::accelerateHorizontal: cleanups
* Properly use v3f default constructor * v3f d_wanted = target_speed - m_speed; and d_wanted = target_speed * 0.1f - m_speed * 0.1f; can be factorized to d_wanted = (target_speed - m_speed) * 0.1f; => d_wanted *= 0.1f;
This commit is contained in:
parent
d65d6160d8
commit
725a0f56db
@ -713,13 +713,13 @@ void LocalPlayer::accelerateHorizontal(const v3f &target_speed,
|
|||||||
|
|
||||||
v3f d_wanted = target_speed - m_speed;
|
v3f d_wanted = target_speed - m_speed;
|
||||||
if (slippery) {
|
if (slippery) {
|
||||||
if (target_speed == v3f(0))
|
if (target_speed == v3f())
|
||||||
d_wanted = -m_speed * 0.05f;
|
d_wanted = -m_speed * 0.05f;
|
||||||
else
|
else
|
||||||
d_wanted = target_speed * 0.1f - m_speed * 0.1f;
|
d_wanted *= 0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
d_wanted.Y = 0;
|
d_wanted.Y = 0.0f;
|
||||||
f32 dl = d_wanted.getLength();
|
f32 dl = d_wanted.getLength();
|
||||||
if (dl > max_increase)
|
if (dl > max_increase)
|
||||||
dl = max_increase;
|
dl = max_increase;
|
||||||
|
Loading…
Reference in New Issue
Block a user