Commit ea6735ad authored by Fedja Beader's avatar Fedja Beader
Browse files

TODO: pos and attach position are still swapped somewhere.

parent cd044fcf
......@@ -144,9 +144,9 @@ state.nodes_to_skip["ignore"] = 1
state.nodes_to_skip["vacuum:vacuum"] = 1
local function step_place(name, above, under) -- "above" is the position of the new node, "under" is where we are attaching to
local function step_place(name, attach_pos, pos)
-- Ensure we have this node selected
l:debug("Placing " .. name .. " at " .. minetest.pos_to_string(above))
l:debug("Placing " .. name .. " at " .. minetest.pos_to_string(pos))
local itemstack = core.localplayer:get_wielded_item()
local oldindex = core.get_wield_index()
if itemstack:get_name() ~= node then
......@@ -160,7 +160,8 @@ local function step_place(name, above, under) -- "above" is the position of the
end
end
core.place_node(under, above)
-- core.place_node(attach_pos, pos) oh well...
core.place_node(pos, attach_pos)
core.set_wield_index(oldindex)
return 0.2
end
......@@ -211,9 +212,9 @@ local function after_layer()
local z = (state.maxz + state.minz)/2
local y = state.active_node.y
local under = { x = x, y = y + 3, z = z }
local above = { x = x, y = y + 2, z = z }
queue:prepend(function() step_place("moreblocks:slab_super_glow_glass_1", above, under) end)
local pos = { x = x, y = y + 2, z = z }
local attach_pos = { x = x, y = y + 3, z = z }
queue:prepend(function() step_place("moreblocks:slab_super_glow_glass_1", attach_pos, pos) end)
end
compact_inventory()
end
......@@ -243,10 +244,9 @@ local function compute_next_step_saved()
local y = node_data.pos.y + anchor_pos.y
local z = node_data.pos.z + anchor_pos.z
-- TODO: API is bugged
local pos = { x = x, y = y - 1, z = z }
local attach_pos = { x = x, y = y - 0, z = z }
queue:append(function() return step_place(node_data.node.name, pos, attach_pos) end)
local pos = { x = x, y = y - 0, z = z }
local attach_pos = { x = x, y = y - 1, z = z }
queue:append(function() return step_place(node_data.node.name, attach_pos, pos) end)
queue:append(function() return queued_ensure_node(attach_pos, node_data.node.name, 5) end)
-- 6) rotate if needed
queue:append(function() return queued_rotate_node(pos, node_data.node.param2) end)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment