summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorSapier <sapier AT gmx dot net>2015-12-19 16:37:13 +0100
committerEkdohibs <nathanael.courant@laposte.net>2017-05-06 21:18:17 +0200
commit45ab62d6a3d90ab3b97aec88251a766cb5dd1899 (patch)
tree7292388cc626953db1070035976795b7fc4f9f03 /src/localplayer.cpp
parent5ebf8f945050e9c74a3bb6784a0844d1fb68bdff (diff)
downloadminetest-45ab62d6a3d90ab3b97aec88251a766cb5dd1899.tar.gz
minetest-45ab62d6a3d90ab3b97aec88251a766cb5dd1899.tar.bz2
minetest-45ab62d6a3d90ab3b97aec88251a766cb5dd1899.zip
Use stepheight from CAO instead of hardcoded value
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index a909ff40f..37aef7afe 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "environment.h"
#include "map.h"
#include "client.h"
+#include "content_cao.h"
/*
LocalPlayer
@@ -343,8 +344,10 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
}
}
- // TODO: this shouldn't be hardcoded but transmitted from server
- float player_stepheight = touching_ground ? (BS*0.6) : (BS*0.2);
+ float player_stepheight = (m_cao == 0) ? 0.0 :
+ (touching_ground ?
+ (m_cao->getStepheight() * BS) :
+ (m_cao->getStepheight() -0.4 * BS));
#ifdef __ANDROID__
player_stepheight += (0.6 * BS);