Fix behaviour on decabling a forcefield emitter
authorZefram <zefram@fysh.org>
Fri, 1 Aug 2014 16:30:21 +0000 (17:30 +0100)
committerZefram <zefram@fysh.org>
Fri, 1 Aug 2014 16:30:21 +0000 (17:30 +0100)
technic/machines/HV/forcefield.lua

index f84cdb47ab5d8afe90e52f4b29340392cb9bfd09..0e530e0d8f47f57cf55c260a185257891be480f7 100644 (file)
@@ -181,7 +181,11 @@ minetest.register_node("technic:forcefield_emitter_on", {
        end,
        mesecons = mesecons,
        technic_run = run,
-       technic_disabled_machine_name = "technic:forcefield_emitter",
+       technic_on_disable = function (pos, node)
+               local meta = minetest.get_meta(pos)
+               update_forcefield(pos, meta:get_int("range"), false)
+               technic.swap_node(pos, "technic:forcefield_emitter_off")
+       end,
 })
 
 minetest.register_node("technic:forcefield", {