summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Euchner <norrepli@gmail.com>2014-07-01 06:42:45 +0200
committerFlorian Euchner <norrepli@gmail.com>2014-07-01 06:42:45 +0200
commitfcd005c1925f2893194310ef736037f135a0c78e (patch)
tree81c663186f490fd8c606425fe1971f6355d7950b
parent1c4db4d675006e471b2f7bbfbffe1b3bfb19ae42 (diff)
parent101a9bbbbef89f353de0818e7388571aa7bf3ab4 (diff)
Merge pull request #15 from ShadowNinja/fix-unknown-nodes
Add a missing check for unknown nodes
-rw-r--r--digilines/wires_common.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/digilines/wires_common.lua b/digilines/wires_common.lua
index 087ceea..44414f2 100644
--- a/digilines/wires_common.lua
+++ b/digilines/wires_common.lua
@@ -42,10 +42,12 @@ function digiline:update_autoconnect(pos, secondcall)
digiline:update_autoconnect(zmympos, true)
end
- local digilinespec = minetest.registered_nodes[minetest.get_node(pos).name].digiline
- if not digilinespec then return nil end
- if not digilinespec.wire then return nil end
- if not digilinespec.wire.use_autoconnect then return nil end
+ local def = minetest.registered_nodes[minetest.get_node(pos).name]
+ local digilinespec = def and def.digiline
+ if not (digilinespec and digilinespec.wire and
+ digilinespec.wire.use_autoconnect) then
+ return nil
+ end
local zmg = digiline:rules_link_anydir(pos, zmpos)
local zmymg = digiline:rules_link_anydir(pos, zmympos)