set direction after moveto

This commit is contained in:
Justus Wolff
2026-02-15 19:44:25 +01:00
parent c26ab898f0
commit d2c77b60f1

View File

@@ -343,7 +343,7 @@ local function printdes(buf, dimensions)
while true do while true do
local target = getnearestunplaced(buf, pbuf, cx,cy,cz,nil, dimensions["x"],dimensions["z"], false) local target = getnearestunplaced(buf, pbuf, cx,cy,cz,nil, dimensions["x"],dimensions["z"], false)
if not target then break end if not target then break end
cx,cz = moveto(target[1],target[2],cx,cz,direction) cx,cz,direction = moveto(target[1],target[2],cx,cz,direction)
place("down") place("down")
pbuf[posasstring(cx,cy,cz)] = true pbuf[posasstring(cx,cy,cz)] = true
end end
@@ -375,14 +375,14 @@ local function printdes(buf, dimensions)
-- build ceiling/floor -- build ceiling/floor
for _cz=1,dimensions["z"],1 do for _cz=1,dimensions["z"],1 do
for _cx=1,dimensions["x"],1 do for _cx=1,dimensions["x"],1 do
moveto(_cx,_cz,cx,cz,direction) cx,cz,direction = moveto(_cx,_cz,cx,cz,direction)
if buf[posasstring(_cx,cy,_cz)] ~= 2 then if buf[posasstring(_cx,cy,_cz)] ~= 2 then
place("down") place("down")
end end
end end
end end
-- return to standard pos but +1 to y -- return to standard pos but +1 to y
moveto(1,1,cx,cz,direction) cx,cz,direction = moveto(1,1,cx,cz,direction)
move("up") move("up")
end end
center(direction) center(direction)