Skip to content

Commit 9b310a6

Browse files
authored
Decrease sneak margin to combat phasing through thin walls (luanti-org#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.
1 parent 2061984 commit 9b310a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/client/localplayer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ bool LocalPlayer::updateSneakNode(Map *map, const v3f &position,
6060
const v3f &sneak_max)
6161
{
6262
// Acceptable distance to node center
63-
constexpr f32 allowed_range = (0.5f + 0.1f) * BS;
63+
// This must be > 0.5 units to get the sneak ladder to work
64+
// 0.05 prevents sideways teleporting through 1/16 thick walls
65+
constexpr f32 allowed_range = (0.5f + 0.05f) * BS;
6466
static const v3s16 dir9_center[9] = {
6567
v3s16( 0, 0, 0),
6668
v3s16( 1, 0, 0),

0 commit comments

Comments
 (0)