aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-02-20 11:31:14 +0100
committerorwell96 <mono96.mml@gmail.com>2017-02-20 11:31:14 +0100
commit6b5f5ea34589088e479e0150a8fdc3ff8e44ca78 (patch)
tree4e706cbfbc03ffd55ef598396a215c9d557d989c
parente4e76322ba74e1ffb465ca5bbfc420d8857aea01 (diff)
downloadadvtrains-6b5f5ea34589088e479e0150a8fdc3ff8e44ca78.tar.gz
advtrains-6b5f5ea34589088e479e0150a8fdc3ff8e44ca78.tar.bz2
advtrains-6b5f5ea34589088e479e0150a8fdc3ff8e44ca78.zip
Fix manual operation of mesecon switches
-rw-r--r--advtrains.zipbin5122954 -> 5123609 bytes
-rw-r--r--advtrains/advtrains_luaautomation/p_mesecon_iface.lua17
2 files changed, 5 insertions, 12 deletions
diff --git a/advtrains.zip b/advtrains.zip
index 34f6ca6..f7e9e1b 100644
--- a/advtrains.zip
+++ b/advtrains.zip
Binary files differ
diff --git a/advtrains/advtrains_luaautomation/p_mesecon_iface.lua b/advtrains/advtrains_luaautomation/p_mesecon_iface.lua
index d7e1052..95e5d8a 100644
--- a/advtrains/advtrains_luaautomation/p_mesecon_iface.lua
+++ b/advtrains/advtrains_luaautomation/p_mesecon_iface.lua
@@ -9,13 +9,9 @@ minetest.override_item("mesecons_switch:mesecon_switch_off", {
save_in_nodedb=1,
},
on_rightclick = function (pos, node)
- if(mesecon.flipstate(pos, node) == "on") then
- mesecon.receptor_on(pos)
- else
- mesecon.receptor_off(pos)
- end
+ advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_on", param2=node.param2})
+ mesecon.receptor_on(pos)
minetest.sound_play("mesecons_switch", {pos=pos})
- advtrains.ndb.update(pos, node)
end,
on_updated_from_nodedb = function(pos, node)
mesecon.receptor_off(pos)
@@ -35,15 +31,12 @@ minetest.override_item("mesecons_switch:mesecon_switch_on", {
groups = {
dig_immediate=2,
save_in_nodedb=1,
+ not_in_creative_inventory=1,
},
on_rightclick = function (pos, node)
- if(mesecon.flipstate(pos, node) == "on") then
- mesecon.receptor_on(pos)
- else
- mesecon.receptor_off(pos)
- end
+ advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_off", param2=node.param2})
+ mesecon.receptor_off(pos)
minetest.sound_play("mesecons_switch", {pos=pos})
- advtrains.ndb.update(pos, node)
end,
on_updated_from_nodedb = function(pos, node)
mesecon.receptor_on(pos)