mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use stepheight from CAO instead of hardcoded value
This commit is contained in:
parent
5ebf8f9450
commit
45ab62d6a3
4 changed files with 19 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue