From 421f897be7ae1ed4553a9166591fb376daa8ac06 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Mon, 5 Feb 2024 22:31:30 +0100 Subject: [PATCH] Let camera shake when it's waiting for a capture For some reason this improves chunk loading. --- files/capture.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/capture.lua b/files/capture.lua index d085055..edaf9fe 100644 --- a/files/capture.lua +++ b/files/capture.lua @@ -80,19 +80,20 @@ local function captureScreenshot(pos, ensureLoaded, dontOverwrite, ctx, outputPi return end - if pos then CameraAPI.SetPos(pos) end - -- Reset the count for the "Waiting for x frames." message in the UI. if ctx then ctx.state.WaitFrames = 0 end -- Wait some additional frames. if captureDelay and captureDelay > 0 then for _ = 1, captureDelay do + if pos then CameraAPI.SetPos(pos + Vec2(math.random(-10, 10), math.random(-10, 10))) end wait(0) if ctx then ctx.state.WaitFrames = ctx.state.WaitFrames + 1 end end end + if pos then CameraAPI.SetPos(pos) end + if ensureLoaded then local delayFrames = 0 repeat