From 9b310a6e6f6674c1d3b423b028185b07445aaeed Mon Sep 17 00:00:00 2001 From: archfan <33993466+archfan7411@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:44:33 -0400 Subject: [PATCH] Decrease sneak margin to combat phasing through thin walls (#13607) A 1/16th-node-thick wall is 0.625 meters thick, and the previous margin of 0.1 meters meant that these walls could be phased through by sneaking against them. A margin lower than 0.625 prevents this. --- src/client/localplayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/localplayer.cpp b/src/client/localplayer.cpp index 6220419f9..a7bcc9689 100644 --- a/src/client/localplayer.cpp +++ b/src/client/localplayer.cpp @@ -60,7 +60,9 @@ bool LocalPlayer::updateSneakNode(Map *map, const v3f &position, const v3f &sneak_max) { // Acceptable distance to node center - constexpr f32 allowed_range = (0.5f + 0.1f) * BS; + // This must be > 0.5 units to get the sneak ladder to work + // 0.05 prevents sideways teleporting through 1/16 thick walls + constexpr f32 allowed_range = (0.5f + 0.05f) * BS; static const v3s16 dir9_center[9] = { v3s16( 0, 0, 0), v3s16( 1, 0, 0),