summaryrefslogtreecommitdiff
path: root/nodes/node_builders.lua
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-09-19 23:25:11 -0600
committerFaceDeer <derksenmobile@gmail.com>2017-09-19 23:25:11 -0600
commit04228904f52214d508831b8df28adcab28e88ae8 (patch)
tree2075b3cdd8de0bdf18ee8ad3e1dc389cbe34bef8 /nodes/node_builders.lua
parent3bc0eb82fa4796c32b6800e5833953262f8e0b0c (diff)
reuse period/offset markers for intermittent diggers
Diffstat (limited to 'nodes/node_builders.lua')
-rw-r--r--nodes/node_builders.lua28
1 files changed, 1 insertions, 27 deletions
diff --git a/nodes/node_builders.lua b/nodes/node_builders.lua
index fac1d4b..bfd7c00 100644
--- a/nodes/node_builders.lua
+++ b/nodes/node_builders.lua
@@ -123,33 +123,7 @@ minetest.register_node("digtron:builder", {
end
if fields.set then
- local buildpos = digtron.find_new_pos(pos, minetest.get_node(pos).param2)
- local x_pos = math.floor((buildpos.x+offset)/period)*period - offset
- minetest.add_entity({x=x_pos, y=buildpos.y, z=buildpos.z}, "digtron:marker")
- if x_pos >= buildpos.x then
- minetest.add_entity({x=x_pos - period, y=buildpos.y, z=buildpos.z}, "digtron:marker")
- end
- if x_pos <= buildpos.x then
- minetest.add_entity({x=x_pos + period, y=buildpos.y, z=buildpos.z}, "digtron:marker")
- end
-
- local y_pos = math.floor((buildpos.y+offset)/period)*period - offset
- minetest.add_entity({x=buildpos.x, y=y_pos, z=buildpos.z}, "digtron:marker_vertical")
- if y_pos >= buildpos.y then
- minetest.add_entity({x=buildpos.x, y=y_pos - period, z=buildpos.z}, "digtron:marker_vertical")
- end
- if y_pos <= buildpos.y then
- minetest.add_entity({x=buildpos.x, y=y_pos + period, z=buildpos.z}, "digtron:marker_vertical")
- end
-
- local z_pos = math.floor((buildpos.z+offset)/period)*period - offset
- minetest.add_entity({x=buildpos.x, y=buildpos.y, z=z_pos}, "digtron:marker"):setyaw(1.5708)
- if z_pos >= buildpos.z then
- minetest.add_entity({x=buildpos.x, y=buildpos.y, z=z_pos - period}, "digtron:marker"):setyaw(1.5708)
- end
- if z_pos <= buildpos.z then
- minetest.add_entity({x=buildpos.x, y=buildpos.y, z=z_pos + period}, "digtron:marker"):setyaw(1.5708)
- end
+ digtron.show_offset_markers(pos, offset, period)
elseif fields.read then
local facing = minetest.get_node(pos).param2