fix an bug where we couldnt index an stack properly

This commit is contained in:
justuswolff
2026-02-19 20:03:27 +01:00
parent 37233f7b42
commit 4f82df6dbb

View File

@@ -677,11 +677,12 @@ local function VP_splitstack(_stack, x)
end end
local out = { local out = {
height=height height=height,
stacks={}
} }
if #unevenstack > 0 then table.insert(out,unevenstack) end if #unevenstack > 0 then table.insert(out["stacks"],unevenstack) end
for _,v in pairs(stacks) do for _,v in pairs(stacks) do
table.insert(out,v) table.insert(out["stacks"],v)
end end
return out return out
end end
@@ -902,11 +903,11 @@ while true do
stacks = VP_splitstack(stacks, expam+1) -- plus 1 because we also build as the master turtle. stacks = VP_splitstack(stacks, expam+1) -- plus 1 because we also build as the master turtle.
for i,v in pairs(accepted) do for i,v in pairs(accepted) do
reset() reset()
print("ID "..tostring(v).." needs "..VP_calccost(stacks[i], stacks["height"],dimensions["x"],dimensions["z"]).." blocks.") print("ID "..tostring(v).." needs "..VP_calccost(stacks["stacks"][i], stacks["height"],dimensions["x"],dimensions["z"]).." blocks.")
print("Please ensure that turtle has that many blocks and press enter to continue.") print("Please ensure that turtle has that many blocks and press enter to continue.")
read("") read("")
rednet.send(v, { rednet.send(v, {
stack=stacks[i], stack=stacks["stacks"][i],
dimensions=dimensions dimensions=dimensions
}, "HB_vprint_pairacknowledge") }, "HB_vprint_pairacknowledge")
end end