Skip to content

Commit

Permalink
Let camera shake when it's waiting for a capture
Browse files Browse the repository at this point in the history
For some reason this improves chunk loading.
  • Loading branch information
Dadido3 committed Feb 5, 2024
1 parent 9c728e0 commit 421f897
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions files/capture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 421f897

Please sign in to comment.