diff options
author | FaceDeer <FaceDeer@users.noreply.github.com> | 2018-05-09 08:17:46 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-09 08:17:46 -0600 |
commit | 6ef9f95a608de5e1464280e93ca5233b25108a75 (patch) | |
tree | 4f70018ff74151635c46490a48f0a2a22df142c7 | |
parent | 9cc52883265cab590da9ce6472c041a816737fd6 (diff) | |
parent | bdc7e8e4f259d6d2b54b70e058842611495b06aa (diff) |
Merge pull request #21 from shivajiva101/shivajiva101-patch-1
fix crash vector
-rw-r--r-- | class_layout.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/class_layout.lua b/class_layout.lua index 7c263a6..14c116b 100644 --- a/class_layout.lua +++ b/class_layout.lua @@ -18,7 +18,10 @@ local get_node_image = function(pos, node) -- Record what kind of thing we've got in a builder node so its facing can be rotated properly if minetest.get_item_group(node.name, "digtron") == 4 then - local build_item = node_image.meta.inventory.main[1] + local build_item = "" + if node_image.meta.inventory.main then + build_item = node_image.meta.inventory.main[1] + end if build_item ~= "" then local build_item_def = minetest.registered_nodes[ItemStack(build_item):get_name()] if build_item_def ~= nil then @@ -462,4 +465,4 @@ function DigtronLayout.deserialize(layout_string) self.old_pos_pointset = Pointset.create() -- needed by the write_layout method, leave empty return self -end
\ No newline at end of file +end |