fix fill hopefully A G A I N
This commit is contained in:
@@ -75,10 +75,10 @@ local function load(name)
|
|||||||
return content["buf"],content["dimensions"]
|
return content["buf"],content["dimensions"]
|
||||||
end
|
end
|
||||||
local function bufistype(buf, x,y,z, targettype)
|
local function bufistype(buf, x,y,z, targettype)
|
||||||
if targettype == 0 then
|
if buf[posasstring(x,y,z)] == targettype then
|
||||||
return (buf[posasstring(x,y,z)] == 0) or (buf[posasstring(x,y,z)] == nil)
|
return true
|
||||||
else
|
else
|
||||||
return buf[posasstring(x,y,z)] == targettype
|
return targettype == 0 and buf[posasstring(x,y,z)] == nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function fill_getneighbors(x,y,z, sx,sz, seltype,buf)
|
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
|
end
|
||||||
local function fill(ntype, x,y,z, buf, sx,sz)
|
local function fill(ntype, x,y,z, buf, sx,sz)
|
||||||
local inittype = buf[posasstring(x,y,z)]
|
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)
|
local neighbors = fill_getneighbors(x,y,z, sx,sz, inittype,buf)
|
||||||
buf[posasstring(x,y,z)] = ntype
|
buf[posasstring(x,y,z)] = ntype
|
||||||
|
|||||||
Reference in New Issue
Block a user