From 94f825c346d0dc3f65aae16eb1c1713ac9615b95 Mon Sep 17 00:00:00 2001 From: justuswolff Date: Tue, 17 Feb 2026 22:07:54 +0100 Subject: [PATCH] fix fill hopefully A G A I N --- src/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.lua b/src/main.lua index 528884f..a9b19ca 100644 --- a/src/main.lua +++ b/src/main.lua @@ -75,10 +75,10 @@ local function load(name) return content["buf"],content["dimensions"] end local function bufistype(buf, x,y,z, targettype) - if targettype == 0 then - return (buf[posasstring(x,y,z)] == 0) or (buf[posasstring(x,y,z)] == nil) + if buf[posasstring(x,y,z)] == targettype then + return true else - return buf[posasstring(x,y,z)] == targettype + return targettype == 0 and buf[posasstring(x,y,z)] == nil end end local function fill_getneighbors(x,y,z, sx,sz, seltype,buf) @@ -91,6 +91,7 @@ local function fill_getneighbors(x,y,z, sx,sz, seltype,buf) end local function fill(ntype, x,y,z, buf, sx,sz) local inittype = buf[posasstring(x,y,z)] + if inittype == ntype then return end -- no work needs to be done local neighbors = fill_getneighbors(x,y,z, sx,sz, inittype,buf) buf[posasstring(x,y,z)] = ntype