attempt to fix createstack and reintroduce optimizestack.
This commit is contained in:
@@ -604,7 +604,7 @@ local function VP_moveto(x,z, cx,cz,direction)
|
|||||||
VP_movetoy(y, 0)
|
VP_movetoy(y, 0)
|
||||||
return cx,cz,direction
|
return cx,cz,direction
|
||||||
end
|
end
|
||||||
local function VP_optimizestack(target) -- partly deprecated for not working!
|
local function VP_optimizestack(target)
|
||||||
-- go from top to bottom and erase false entries until we encounter a true one.
|
-- go from top to bottom and erase false entries until we encounter a true one.
|
||||||
local index = #target
|
local index = #target
|
||||||
while #target > 0 do
|
while #target > 0 do
|
||||||
@@ -628,15 +628,15 @@ local function VP_createstack(buf, dimensions)
|
|||||||
for z=1,dimensions["z"],1 do
|
for z=1,dimensions["z"],1 do
|
||||||
|
|
||||||
local tempbuf = {}
|
local tempbuf = {}
|
||||||
for y=1,dimensions["y"],1 do -- for each y dimension
|
for y=1,dimensions["y"]+1,1 do -- for each y dimension
|
||||||
local placecode = buf[posasstring(x,y,z)]
|
local placecode = buf[posasstring(x,y,z)]
|
||||||
for layer=1,3,1 do -- layers
|
for layer=1,3,1 do -- layers
|
||||||
table.insert(tempbuf, needstobeplaced(placecode, layer))
|
table.insert(tempbuf, needstobeplaced(placecode, layer))
|
||||||
end
|
end
|
||||||
-- ceiling
|
-- ceiling
|
||||||
table.insert(tempbuf, buf[posasstring(_cx,cy,_cz)] ~= 2)
|
table.insert(tempbuf, buf[posasstring(x,y,z)] ~= 2)
|
||||||
end
|
end
|
||||||
--VP_optimizestack(tempbuf)
|
VP_optimizestack(tempbuf)
|
||||||
|
|
||||||
if #tempbuf > 0 then out[posasstring(x,z)] = tempbuf end
|
if #tempbuf > 0 then out[posasstring(x,z)] = tempbuf end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user