diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-07-23 20:44:56 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-07-23 20:44:56 +0300 |
commit | e8331f0c1db5d7e0edf97d26e4b6f5a88d9ffa03 (patch) | |
tree | 14da6adc799f2f82993c3c106f495d66ca5485a3 /builtin | |
parent | c009aa3a22b0a2d5790898ac05c92d429c82f94a (diff) | |
download | minetest-e8331f0c1db5d7e0edf97d26e4b6f5a88d9ffa03.tar.gz minetest-e8331f0c1db5d7e0edf97d26e4b6f5a88d9ffa03.tar.bz2 minetest-e8331f0c1db5d7e0edf97d26e4b6f5a88d9ffa03.zip |
Add oldnode parameter to minetest.register_on_placenode callback
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/item.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/item.lua b/builtin/item.lua index 08b8d1c58..e19fd559a 100644 --- a/builtin/item.lua +++ b/builtin/item.lua @@ -152,7 +152,8 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) minetest.log("action", placer:get_player_name() .. " places node " .. def.name .. " at " .. minetest.pos_to_string(place_to)) - + + local oldnode = minetest.env:get_node(place_to) local newnode = {name = def.name, param1 = 0, param2 = 0} -- Calculate direction for wall mounted stuff like torches and signs @@ -188,7 +189,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing) -- Run script hook (deprecated) local _, callback for _, callback in ipairs(minetest.registered_on_placenodes) do - callback(place_to, newnode, placer) + callback(place_to, newnode, placer, oldnode) end itemstack:take_item() |