From 5ab8ca4da15f1dd6d7de9cbafabf8c2407d0973c Mon Sep 17 00:00:00 2001 From: Thekuca <63980591+Thekuca@users.noreply.github.com> Date: Sun, 7 May 2023 21:28:40 +0200 Subject: [PATCH] refactor(modules/timeout): format code --- [core]/es_extended/common/modules/timeout.lua | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/[core]/es_extended/common/modules/timeout.lua b/[core]/es_extended/common/modules/timeout.lua index cb56de7b..419fff1a 100644 --- a/[core]/es_extended/common/modules/timeout.lua +++ b/[core]/es_extended/common/modules/timeout.lua @@ -2,22 +2,22 @@ local TimeoutCount = 0 local CancelledTimeouts = {} ESX.SetTimeout = function(msec, cb) - local id = TimeoutCount + 1 + local id = TimeoutCount + 1 - SetTimeout(msec, function() - if CancelledTimeouts[id] then - CancelledTimeouts[id] = nil - return - end - - cb() - end) + SetTimeout(msec, function() + if CancelledTimeouts[id] then + CancelledTimeouts[id] = nil + return + end - TimeoutCount = id + cb() + end) - return id + TimeoutCount = id + + return id end ESX.ClearTimeout = function(id) - CancelledTimeouts[id] = true -end \ No newline at end of file + CancelledTimeouts[id] = true +end