Fix predefined area error

This commit is contained in:
David Vogel 2024-05-07 01:12:11 +02:00
parent 0065afe413
commit 203a0ea159

View File

@ -770,10 +770,11 @@ function Capture:StartCapturing()
self:StartCapturingAreaScan(topLeft, bottomRight, captureGridSize, outputPixelScale, captureDelay) self:StartCapturingAreaScan(topLeft, bottomRight, captureGridSize, outputPixelScale, captureDelay)
else else
---@type fun():Vec2, Vec2
local predefinedAreaFunction = Config.CaptureArea[area] local predefinedAreaFunction = Config.CaptureArea[area]
if predefinedAreaFunction then if predefinedAreaFunction then
local predefinedArea = predefinedAreaFunction() local topLeft, bottomRight = predefinedAreaFunction()
self:StartCapturingAreaScan(predefinedArea.TopLeft, predefinedArea.BottomRight, captureGridSize, outputPixelScale, captureDelay) self:StartCapturingAreaScan(topLeft, bottomRight, captureGridSize, outputPixelScale, captureDelay)
else else
Message:ShowRuntimeError("PredefinedArea", string.format("Unknown predefined capturing area %q", tostring(area))) Message:ShowRuntimeError("PredefinedArea", string.format("Unknown predefined capturing area %q", tostring(area)))
end end