diff options
author | RealBadAngel <mk@realbadangel.pl> | 2013-08-04 15:16:00 +0200 |
---|---|---|
committer | RealBadAngel <mk@realbadangel.pl> | 2013-08-04 15:16:00 +0200 |
commit | 3b32bf7907c20e226698a2a3af2807a7b1359661 (patch) | |
tree | 5b8c31309a5c0af63892be27eb8a3c0008c74fcf | |
parent | e08ee759901424a95047487a4ec9539154ea94cd (diff) |
Fix wrench crashes
-rw-r--r-- | wrench/init.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/wrench/init.lua b/wrench/init.lua index 0d1590a..2c64d78 100644 --- a/wrench/init.lua +++ b/wrench/init.lua @@ -292,10 +292,10 @@ for name,info in pairs(supported_nodes) do newdef.after_place_node = function(pos, placer, itemstack) minetest.set_node(pos, {name = convert_to_original_name(itemstack:get_name()), param2 = minetest.get_node(pos).param2}) - minetest.after(0.5, function(pos, placer, itemstack) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - local data = minetest.deserialize(itemstack:get_metadata()) + local item_meta =itemstack:to_table() + local data = minetest.deserialize(item_meta["metadata"]) local lists = data.lists for listname,list in pairs(lists) do inv:set_list(listname, list) @@ -314,7 +314,6 @@ for name,info in pairs(supported_nodes) do meta:set_float(temp.float, temp.value) end end - end, pos, placer, itemstack) end minetest.register_node(info.name, newdef) end @@ -409,4 +408,4 @@ minetest.register_craft({ {"","default:steel_ingot",""}, {"","default:steel_ingot",""}, }, -})
\ No newline at end of file +}) |