summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-07-20 23:30:43 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2015-07-21 08:10:43 +0200
commitfa7fe510d9b77c0a7802604a5697de4e52cddba3 (patch)
tree6e65917fc32db32940cdcd954c5eb54b0285a1dc /src/player.cpp
parent5ebb4237e204bfa760313f6f2a46a09dceb9cce0 (diff)
downloadminetest-fa7fe510d9b77c0a7802604a5697de4e52cddba3.tar.gz
minetest-fa7fe510d9b77c0a7802604a5697de4e52cddba3.tar.bz2
minetest-fa7fe510d9b77c0a7802604a5697de4e52cddba3.zip
Remove profiler.h include where it's not needed. Remove some unreachable and very old code
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 26496259c..668d490cc 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -119,31 +119,12 @@ void Player::accelerateHorizontal(v3f target_speed, f32 max_increase)
f32 dl = d_wanted.getLength();
if(dl > max_increase)
dl = max_increase;
-
+
v3f d = d_wanted.normalize() * dl;
m_speed.X += d.X;
m_speed.Z += d.Z;
-#if 0 // old code
- if(m_speed.X < target_speed.X - max_increase)
- m_speed.X += max_increase;
- else if(m_speed.X > target_speed.X + max_increase)
- m_speed.X -= max_increase;
- else if(m_speed.X < target_speed.X)
- m_speed.X = target_speed.X;
- else if(m_speed.X > target_speed.X)
- m_speed.X = target_speed.X;
-
- if(m_speed.Z < target_speed.Z - max_increase)
- m_speed.Z += max_increase;
- else if(m_speed.Z > target_speed.Z + max_increase)
- m_speed.Z -= max_increase;
- else if(m_speed.Z < target_speed.Z)
- m_speed.Z = target_speed.Z;
- else if(m_speed.Z > target_speed.Z)
- m_speed.Z = target_speed.Z;
-#endif
}
// Vertical acceleration (Y), X and Z directions are ignored
@@ -160,16 +141,6 @@ void Player::accelerateVertical(v3f target_speed, f32 max_increase)
m_speed.Y += d_wanted;
-#if 0 // old code
- if(m_speed.Y < target_speed.Y - max_increase)
- m_speed.Y += max_increase;
- else if(m_speed.Y > target_speed.Y + max_increase)
- m_speed.Y -= max_increase;
- else if(m_speed.Y < target_speed.Y)
- m_speed.Y = target_speed.Y;
- else if(m_speed.Y > target_speed.Y)
- m_speed.Y = target_speed.Y;
-#endif
}
v3s16 Player::getLightPosition() const