From d0cbd7d73eb3a2f192429d8ebef4994e78b0cfe6 Mon Sep 17 00:00:00 2001 From: Athozus Date: Sat, 6 Apr 2024 16:17:49 +0200 Subject: [PATCH] Remove unnecessary normalization Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com> --- technic/machines/register/cables.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 0b70aca8..27fe6a0f 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -103,9 +103,7 @@ function technic.register_cable_plate(nodename, data) if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) and index ~= 0 then local fine_pointed = minetest.pointed_thing_to_face_pos(placer, pointed_thing) fine_pointed = vector.direction(pointed_thing.above,fine_pointed) - -- Normalize direction to prevent `xyz` index overflow with oversize nodes - index = (math.abs(index)-1)%3+1 - fine_pointed[xyz[index]] = nil + fine_pointed[xyz[index < 0 and -index or index]] = nil local key_a, a = next(fine_pointed) local key_b, b = next(fine_pointed, key_a) local far_key = math.abs(a) > math.abs(b) and key_a or key_b