diff options
author | orwell96 <orwell@bleipb.de> | 2020-07-07 14:25:47 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2020-07-07 14:25:47 +0200 |
commit | f33bb563e78a62cc8fb2e1483a6cb9a2436b708a (patch) | |
tree | a3690d6dbc6a04c82e4aad78f3fb5d2f90fa533d /advtrains_luaautomation | |
parent | 96236c04dc790cbcd4d8cb52aee5563f54e736aa (diff) | |
download | advtrains-f33bb563e78a62cc8fb2e1483a6cb9a2436b708a.tar.gz advtrains-f33bb563e78a62cc8fb2e1483a6cb9a2436b708a.tar.bz2 advtrains-f33bb563e78a62cc8fb2e1483a6cb9a2436b708a.zip |
Add "Fallback state" for freed routes, move p_mesecon_iface.lua to core
Diffstat (limited to 'advtrains_luaautomation')
-rw-r--r-- | advtrains_luaautomation/init.lua | 4 | ||||
-rw-r--r-- | advtrains_luaautomation/p_mesecon_iface.lua | 53 |
2 files changed, 1 insertions, 56 deletions
diff --git a/advtrains_luaautomation/init.lua b/advtrains_luaautomation/init.lua index 573a553..eca5633 100644 --- a/advtrains_luaautomation/init.lua +++ b/advtrains_luaautomation/init.lua @@ -33,9 +33,7 @@ dofile(mp.."/active_common.lua") dofile(mp.."/atc_rail.lua") dofile(mp.."/operation_panel.lua") dofile(mp.."/pcnaming.lua") -if mesecon then - dofile(mp.."/p_mesecon_iface.lua") -end + dofile(mp.."/chatcmds.lua") diff --git a/advtrains_luaautomation/p_mesecon_iface.lua b/advtrains_luaautomation/p_mesecon_iface.lua deleted file mode 100644 index 95e5d8a..0000000 --- a/advtrains_luaautomation/p_mesecon_iface.lua +++ /dev/null @@ -1,53 +0,0 @@ --- p_mesecon_iface.lua --- Mesecons interface by overriding the switch - -if not mesecon then return end - -minetest.override_item("mesecons_switch:mesecon_switch_off", { - groups = { - dig_immediate=2, - save_in_nodedb=1, - }, - on_rightclick = function (pos, node) - 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}) - end, - on_updated_from_nodedb = function(pos, node) - mesecon.receptor_off(pos) - end, - luaautomation = { - getstate = "off", - setstate = function(pos, node, newstate) - if newstate=="on" then - advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_on", param2=node.param2}) - mesecon.receptor_on(pos) - end - end, - }, -}) - -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) - 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}) - end, - on_updated_from_nodedb = function(pos, node) - mesecon.receptor_on(pos) - end, - luaautomation = { - getstate = "on", - setstate = function(pos, node, newstate) - if newstate=="off" then - advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_off", param2=node.param2}) - mesecon.receptor_off(pos) - end - end, - }, -}) |