Skip to content

Commit

Permalink
Remove unnecessary normalization
Browse files Browse the repository at this point in the history
Co-authored-by: SX <[email protected]>
  • Loading branch information
Athozus and S-S-X authored Apr 6, 2024
1 parent 51cc15a commit 90a207d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions technic/machines/register/cables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90a207d

Please sign in to comment.