Skip to content

Commit

Permalink
Use modulo to bring back index > 3 within {x,y,z} range
Browse files Browse the repository at this point in the history
  • Loading branch information
Athozus committed Apr 1, 2024
1 parent bc07148 commit f85db6e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions technic/machines/register/cables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +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.subtract(fine_pointed, pointed_thing.above)
index = (index-1)%3+1
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)
Expand Down

0 comments on commit f85db6e

Please sign in to comment.