aboutsummaryrefslogtreecommitdiff
path: root/src/camera.cpp
diff options
context:
space:
mode:
authorZeg9 <dazeg9@gmail.com>2012-12-27 14:22:59 +0100
committerPilzAdam <pilzadam@minetest.net>2013-04-03 23:22:40 +0200
commitc1bf6f9f7a6d2c5bd743422593a5ec72939bc6af (patch)
tree5240ea28a91a97628d959217261901071a0882ba /src/camera.cpp
parentf85c1165c2ea9abbfe426b014dacb7b04238fbea (diff)
downloadminetest-c1bf6f9f7a6d2c5bd743422593a5ec72939bc6af.tar.gz
minetest-c1bf6f9f7a6d2c5bd743422593a5ec72939bc6af.tar.bz2
minetest-c1bf6f9f7a6d2c5bd743422593a5ec72939bc6af.zip
Fix camera "jumping" when attached and the parent goes too fast
Diffstat (limited to 'src/camera.cpp')
-rw-r--r--src/camera.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index b1e588415..138b022c0 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -218,6 +218,8 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize,
// 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)
if(player->touching_ground &&
player_position.Y > old_player_position.Y)