From 191204184ef98452dec17686337c1068856568c9 Mon Sep 17 00:00:00 2001 From: justuswolff Date: Tue, 17 Feb 2026 02:07:19 +0100 Subject: [PATCH] fix attempt #2 --- src/main.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.lua b/src/main.lua index 59a18e8..7c0637e 100644 --- a/src/main.lua +++ b/src/main.lua @@ -385,13 +385,13 @@ local function render(buf, pbuf, cx,cy,cz, tx,tz, sx,sz, shouldsetlist,invertsli } local tsx,tsy = term.getSize() - local camx,camy = cx+tsx/2,cz+tsy/2 + local camx,camy = cx-tsx/2,cz-tsy/2 reset() - for x=1+camx,sx+camx,1 do - for z=1+camy,sz+camy,1 do - local currentbuf = pbuf[posasstring(x, cy, z)] - term.setCursorPos(x-camx, z-camy) + for x=1,sx,1 do + for z=1,sz,1 do + local currentbuf = pbuf[posasstring(x+camx, cy, z+camy)] + term.setCursorPos(x+camx, z+camy) if currentbuf then -- wall term.blit(" ", colors.toBlit(colors.white), colors.toBlit(colors.white)) elseif (currentbuf == false or currentbuf == nil) and (invertslist and not tcontains(shouldsetlist, buf[posasstring(x, cy, z)]) or tcontains(shouldsetlist, buf[posasstring(x, cy, z)])) then -- nothing @@ -399,9 +399,9 @@ local function render(buf, pbuf, cx,cy,cz, tx,tz, sx,sz, shouldsetlist,invertsli end end end - term.setCursorPos(cx,cz) + term.setCursorPos(cx+camx,cz+camy) term.blit(" ", colors.toBlit(colors.red), colors.toBlit(colors.red)) - term.setCursorPos(tx,tz) + term.setCursorPos(tx+camx,tz+camy) term.blit(" ", colors.toBlit(colors.lime), colors.toBlit(colors.lime)) end local function printdes(buf, dimensions)