From bbe66a70aee7cad9aee7e9d4a4bc5b75dc563b34 Mon Sep 17 00:00:00 2001 From: Linventif Date: Sun, 7 Jul 2024 23:24:34 +0000 Subject: [PATCH] fix: send the 100nt error if repeat --- lua/gmod_integration/shared/sh_errors.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/gmod_integration/shared/sh_errors.lua b/lua/gmod_integration/shared/sh_errors.lua index 8ba7992..2b39e65 100644 --- a/lua/gmod_integration/shared/sh_errors.lua +++ b/lua/gmod_integration/shared/sh_errors.lua @@ -1,14 +1,15 @@ local cacheErrors = {} function gmInte.sendLuaErrorReport(err, realm, stack, name, id) + local count = cacheErrors[err] && cacheErrors[err].count + 1 || 1 cacheErrors[err] = { ["time"] = CurTime(), - ["count"] = cacheErrors[err] && cacheErrors[err].count + 1 || 1, + ["count"] = count, } if !gmInte.config.id || !gmInte.config.token then return end if CLIENT && !IsValid(LocalPlayer()) then return end - local count = cacheErrors[err].count timer.Simple(0.5, function() + if !cacheErrors[err] then return end if cacheErrors[err].count != count then if cacheErrors[err].count != 100 then return end else