Refactor Target resource name function placement

Moved the GetResourceName function definition to the top of both ox_target and qb-target client modules for consistency and clarity. Also performed minor code cleanup and reordering for improved readability.
This commit is contained in:
MrNewb committed 2025-10-19 22:59:18 -04:00
1 parent 45a98528b1
commit 664b397404
2 files changed
+19 -10

No files matched your search

+9 -4
View File
@@ -5,9 +5,17 @@ if GetResourceState("ox_target") ~= 'missing' then return end
Target = Target or {}
local targetDebug = BridgeSharedConfig and BridgeSharedConfig.DebugLevel == 2 or false
local targetZones = {}
Target = Target or {}
local qb_target = exports['qb-target']
Target.GetResourceName = function()
return "qb-target"
end
function GetLargestDistance(data)
local largestDistance = -1
for _, v in pairs(data) do
@@ -18,6 +26,7 @@ function GetLargestDistance(data)
return largestDistance ~= -1 and largestDistance or 2.0
end
---This is an internal function that is used to fix the options passed to fit alternative target systems, for example qb-ox or ox-qb etc.
---@param options table
---@return table
@@ -222,8 +231,4 @@ AddEventHandler('onResourceStop', function(resource)
targetZones = {}
end)
Target.GetResourceName = function()
return "qb-target"
end
return Target