From 2ed5b8801cbdf913edf120cde1ca395bd4361d4d Mon Sep 17 00:00:00 2001 From: matkal-2 Date: Sun, 11 Oct 2015 12:45:49 +0200 Subject: [PATCH] Fixed issue #3087, sneak glitch. --- src/localplayer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 77e7a9e16..5088ecdfa 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -176,6 +176,12 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d, // Maximum distance over border for sneaking f32 sneak_max = BS*0.4; + // If not touching_ground then we cannot let player sneak + if (!touching_ground) + { + control.sneak = false; + } + /* If sneaking, keep in range from the last walked node and don't fall off from it