summaryrefslogtreecommitdiff
path: root/railtrack/init.lua
diff options
context:
space:
mode:
authorstujones11 <stujones111@gmail.com>2016-01-13 19:51:50 +0000
committerstujones11 <stujones111@gmail.com>2016-01-13 21:06:38 +0000
commit4416e9b8ad399afa9016a9454e2f84926797cbb5 (patch)
tree26ebd2fc79da9181d26c2dd78cdd32ed7d013381 /railtrack/init.lua
parent6dfdaf78522a9c92e4323fa5bb77eb3a7c11aa30 (diff)
Remove placement privs until a better solution is found & misc fixes
Diffstat (limited to 'railtrack/init.lua')
-rw-r--r--railtrack/init.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/railtrack/init.lua b/railtrack/init.lua
index 373fcaa..353249f 100644
--- a/railtrack/init.lua
+++ b/railtrack/init.lua
@@ -96,11 +96,14 @@ minetest.register_tool("railtrack:fixer", {
end
end
local node = minetest.get_node(pos)
- minetest.remove_node(pos)
- set_node(pos, node)
- local def = minetest.registered_items[node.name] or {}
- if type(def.after_place_node) == "function" then
- def.after_place_node(pos, user, node)
+ if node then
+ minetest.remove_node(pos)
+ minetest.set_node(pos, node)
+ local def = minetest.registered_items[node.name] or {}
+ local itemstack = ItemStack(node.name)
+ if type(def.after_place_node) == "function" then
+ def.after_place_node(pos, user, itemstack)
+ end
end
end,
})