Fix Electricity (Again)

This commit is contained in:
IamPyu 2024-10-03 16:21:54 -06:00
parent 92ce0a48a0
commit a8544bbce7

View File

@ -33,6 +33,7 @@ end
PyuTest.make_wire = function(id, desc, groups, color, opts, texture, delay)
local del = PyuTest.ELECTRICITY_TICK * delay
minetest.log(tostring(del))
PyuTest.make_node(id, desc, PyuTest.util.tableconcat(groups, {
electric = 1
@ -47,7 +48,7 @@ PyuTest.make_wire = function(id, desc, groups, color, opts, texture, delay)
paramtype = "light",
sunlight_propagates = true,
walkable = false,
inventory_image = "pyutest-wire.png",
inventory_image = texture or "pyutest-wire.png",
__on_electricity_activated = function(pos, node, sender_pos)
for _, v in pairs(PyuTest.get_neighbours(pos)) do
@ -58,8 +59,8 @@ PyuTest.make_wire = function(id, desc, groups, color, opts, texture, delay)
goto continue
end
minetest.after(tonumber(del), function()
PyuTest.electricity_activate(v, n, sender_pos)
minetest.after(del, function()
PyuTest.electricity_activate(v, n, pos)
end)
::continue::