aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-09-03 23:31:51 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-09-03 23:31:51 +0300
commit0e6f7a21c60d162b3b7134882dc22dbd8acd014f (patch)
treee24554ee70af36c7a4500e8ba0da891bc9b4b62d
parentcc47ff7c4cd3a2ae1685f19c52da98164befcd0a (diff)
downloadminetest-0e6f7a21c60d162b3b7134882dc22dbd8acd014f.tar.gz
minetest-0e6f7a21c60d162b3b7134882dc22dbd8acd014f.tar.bz2
minetest-0e6f7a21c60d162b3b7134882dc22dbd8acd014f.zip
Fix shift-descend to ladders from a floor
-rw-r--r--src/localplayer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 46a10c90b..4b5e53fea 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -150,13 +150,16 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
position.X = rangelim(position.X, lwn_f.X-maxd, lwn_f.X+maxd);
position.Z = rangelim(position.Z, lwn_f.Z-maxd, lwn_f.Z+maxd);
- f32 min_y = lwn_f.Y + 0.5*BS;
- if(position.Y < min_y)
+ if(!is_climbing)
{
- position.Y = min_y;
+ f32 min_y = lwn_f.Y + 0.5*BS;
+ if(position.Y < min_y)
+ {
+ position.Y = min_y;
- if(m_speed.Y < 0)
- m_speed.Y = 0;
+ if(m_speed.Y < 0)
+ m_speed.Y = 0;
+ }
}
}