Skip to content

Instantly share code, notes, and snippets.

@HybridDog
Last active December 21, 2015 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HybridDog/45ddedf3cb33db330815 to your computer and use it in GitHub Desktop.
Save HybridDog/45ddedf3cb33db330815 to your computer and use it in GitHub Desktop.
local current_pos
local actual_node_get = minetest.get_node_or_nil
local function temp_node_get(pos, ...)
current_pos = pos
return actual_node_get(pos, ...)
end
local actual_turnon = mesecon.turnon
function mesecon.turnon(...)
minetest.get_node_or_nil = temp_node_get
--local v = actual_turnon(pos, ...) commented because mesecon.turnon now doesn't return sth
actual_turnon(...)
minetest.get_node_or_nil = actual_node_get
current_pos = nil
--return v
end
local actual_is_conductor_off = mesecon.is_conductor_off
function mesecon.is_conductor_off(...)
if current_pos
and is_jammed(current_pos) then
return
end
return actual_is_conductor_off(...)
end
local actual_is_effector = mesecon.is_effector
function mesecon.is_effector(...)
if current_pos
and is_jammed(current_pos) then
return
end
return actual_is_effector(...)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment