mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-30 13:24:44 +00:00
fix(imports/waitFor): normalise timeout
This commit is contained in:
1 parent
4ed709df9a
commit
6817ae6649
1 file changed
+6
-2
@@ -11,8 +11,12 @@ function lib.waitFor(cb, errMessage, timeout)
|
|||||||
|
|
||||||
if value ~= nil then return value end
|
if value ~= nil then return value end
|
||||||
|
|
||||||
if timeout or timeout == nil then
|
timeout = tonumber(timeout) or 1000
|
||||||
timeout = tonumber(timeout) or 1000
|
|
||||||
|
if IsDuplicityVersion() then
|
||||||
|
timeout /= 50;
|
||||||
|
else
|
||||||
|
timeout -= GetFrameTime() * 1000;
|
||||||
end
|
end
|
||||||
|
|
||||||
local start = GetGameTimer()
|
local start = GetGameTimer()
|
||||||
|
|||||||
Reference in new issue
Block a user