fix: iterate in reverse

This commit is contained in:
2025-05-08 01:27:57 -03:00
parent 4638994190
commit a6ce7c8b48
+2 -2
View File
@@ -279,7 +279,7 @@ function drawLogs(x0, y0, x1, y1)
messageFG = prevColourFg messageFG = prevColourFg
end end
for lineIdx, line in ipairs(wrappedMessage) do for lineIdx=#wrappedMessage,1, -1 do
if drawnLines > h then break end if drawnLines > h then break end
term.setCursorPos(1, y1 - drawnLines) term.setCursorPos(1, y1 - drawnLines)
@@ -295,7 +295,7 @@ function drawLogs(x0, y0, x1, y1)
term.setBackgroundColor(messageBG) term.setBackgroundColor(messageBG)
term.setTextColor(messageFG) term.setTextColor(messageFG)
term.write(line) term.write(wrappedMessage[lineIdx])
local remaining = w - (prefixLength + #line) local remaining = w - (prefixLength + #line)
if remaining > 0 then if remaining > 0 then