From c20b6b7eba924df19f3302f038f7d1955267db1c Mon Sep 17 00:00:00 2001 From: Justus Wolff Date: Mon, 23 Feb 2026 00:42:54 +0100 Subject: [PATCH] change a few things --- src/main.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.lua b/src/main.lua index 0a8a2d3..4cb2c2d 100644 --- a/src/main.lua +++ b/src/main.lua @@ -612,12 +612,10 @@ local function VP_moveto(x,z, cx,cz,direction) return cx,cz,direction end local function VP_optimizestack(target) - -- go from top to bottom and erase false entries until we encounter a true one. - local index = #target + -- go from bottom to top and erase false entries until we encounter a true one. while #target > 0 do - if target[index] then break else - table.remove(target, index) - index = index - 1 + if target[1] then break else + table.remove(target, 1) end end @@ -719,7 +717,7 @@ local function VP_printstack(buf, dimensions, cx,cy,cz,direction) local tempbuf = buf["stacks"][posasstring(x,z)] if tempbuf then cx,cz,direction = VP_moveto(x,z, cx,cz,direction) - for _=1,buf["height"],1 do + for _=1,#tempbuf,1 do move("down", true) end for _,v in pairs(tempbuf) do