aboutsummaryrefslogtreecommitdiff
path: root/src/client/camera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/camera.cpp')
-rw-r--r--src/client/camera.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/camera.cpp b/src/client/camera.cpp
index d1e76026d..464644044 100644
--- a/src/client/camera.cpp
+++ b/src/client/camera.cpp
@@ -285,9 +285,13 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_r
// Smooth the movement when walking up stairs
v3f old_player_position = m_playernode->getPosition();
v3f player_position = player->getPosition();
- if (player->isAttached && player->parent)
- player_position = player->parent->getPosition();
- //if(player->touching_ground && player_position.Y > old_player_position.Y)
+
+ // This is worse than `LocalPlayer::getPosition()` but
+ // mods expect the player head to be at the parent's position
+ // plus eye height.
+ if (player->getParent())
+ player_position = player->getParent()->getPosition();
+
if(player->touching_ground &&
player_position.Y > old_player_position.Y)
{