mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-02-03 22:00:19 +01:00
[mesecons] Add back blinky fix with flags
This commit is contained in:
parent
beaaee1330
commit
66ab74194d
@ -10,11 +10,25 @@ local toggle_timer = function (pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local on_timer = function (pos)
|
local on_timer = function (pos)
|
||||||
local node = minetest.get_node(pos)
|
-- DO NOT TOUCH OR.. THREATS! Thanks, MFF
|
||||||
if(mesecon.flipstate(pos, node) == "on") then
|
local activate = false
|
||||||
mesecon.receptor_on(pos)
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
else
|
local p = player:getpos()
|
||||||
mesecon.receptor_off(pos)
|
local dist = ((p.x-pos.x)^2 + (p.y-pos.y)^2 + (p.z-pos.z)^2)^0.5
|
||||||
|
if dist < 40 then
|
||||||
|
activate = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if activate then
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
if(mesecon.flipstate(pos, node) == "on") then
|
||||||
|
mesecon.receptor_on(pos)
|
||||||
|
else
|
||||||
|
mesecon.receptor_off(pos)
|
||||||
|
end
|
||||||
|
-- Our modification stops there, thank you, @crabman77
|
||||||
end
|
end
|
||||||
toggle_timer(pos)
|
toggle_timer(pos)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user