From 3a9424659bff9e80910a26a5291468ffdc18f3ff Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:04:54 -0400 Subject: [PATCH] Refactor Dispatch.SendAlert for clarity Assigns alert data to a local variable before passing it to exports.tk_dispatch:addCall, improving readability and maintainability. --- modules/dispatch/tk_dispatch/client/client.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/dispatch/tk_dispatch/client/client.lua b/modules/dispatch/tk_dispatch/client/client.lua index f7c0740..6c96e05 100644 --- a/modules/dispatch/tk_dispatch/client/client.lua +++ b/modules/dispatch/tk_dispatch/client/client.lua @@ -3,7 +3,7 @@ if GetResourceState('tk_dispatch') == 'missing' then return end Dispatch = Dispatch or {} Dispatch.SendAlert = function(data) - exports.tk_dispatch:addCall({ + local alertData = { title = data.message, code = data.code or '10-80', priority = 'Priority 3', @@ -17,7 +17,8 @@ Dispatch.SendAlert = function(data) scale = data.blipData.scale or 0.8, }, jobs = data.jobs or {'police'}, - }) + } + exports.tk_dispatch:addCall(alertData) end ---This will get the name of the in use resource.