Skip to content

Commit

Permalink
Frames: Fix error in node placement callback execution
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed May 18, 2024
1 parent 80dee96 commit f80372a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions technic/machines/other/frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ for zp = 0, 1 do

on_rightclick = function(pos, node, placer, itemstack, pointed_thing)
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
minetest.log("action", placer:get_player_name()
.. " tried to place " .. itemstack:get_name()
Expand All @@ -347,8 +348,7 @@ for zp = 0, 1 do
end

-- Run script hook
local callback = nil
for _, _ in ipairs(minetest.registered_on_placenodes) do
for _, callback in ipairs(minetest.registered_on_placenodes) do
-- Copy pos and node because callback can modify them
local pos_copy = { x = pos.x, y = pos.y, z = pos.z }
local newnode_copy = { name = def.name, param1 = 0, param2 = 0 }
Expand Down

0 comments on commit f80372a

Please sign in to comment.