mirror of
https://github.com/minetest-mods/technic.git
synced 2025-01-09 17:50:21 +01:00
Frames: Fix error in node placement callback execution
This commit is contained in:
parent
80dee96dbe
commit
f80372a0f8
@ -324,6 +324,7 @@ for zp = 0, 1 do
|
|||||||
|
|
||||||
on_rightclick = function(pos, node, placer, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, placer, itemstack, pointed_thing)
|
||||||
if is_supported_node(itemstack:get_name()) then
|
if is_supported_node(itemstack:get_name()) then
|
||||||
|
-- Stripped down version of "core.item_place_node"
|
||||||
if minetest.is_protected(pos, placer:get_player_name()) then
|
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||||
minetest.log("action", placer:get_player_name()
|
minetest.log("action", placer:get_player_name()
|
||||||
.. " tried to place " .. itemstack:get_name()
|
.. " tried to place " .. itemstack:get_name()
|
||||||
@ -347,8 +348,7 @@ for zp = 0, 1 do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Run script hook
|
-- Run script hook
|
||||||
local callback = nil
|
for _, callback in ipairs(minetest.registered_on_placenodes) do
|
||||||
for _, _ in ipairs(minetest.registered_on_placenodes) do
|
|
||||||
-- Copy pos and node because callback can modify them
|
-- Copy pos and node because callback can modify them
|
||||||
local pos_copy = { x = pos.x, y = pos.y, z = pos.z }
|
local pos_copy = { x = pos.x, y = pos.y, z = pos.z }
|
||||||
local newnode_copy = { name = def.name, param1 = 0, param2 = 0 }
|
local newnode_copy = { name = def.name, param1 = 0, param2 = 0 }
|
||||||
|
Loading…
Reference in New Issue
Block a user