Compare commits

..

3 Commits

Author SHA1 Message Date
Jim Shield
54b1280bef Remove debug print 2025-09-21 12:09:12 +01:00
Jim Shield
3ac65d4630 Add "pre support" for jim-shops exploit security 2025-09-21 12:00:05 +01:00
Jim Shield
ed49876c69 Fix cleanup of targets for qb-target
Realised it was trying to remove `nil` when players were unloading/the scripts were ensured
2025-09-21 10:35:22 +01:00
2 changed files with 15 additions and 9 deletions

View File

@@ -2688,6 +2688,13 @@ function registerShop(name, label, items, society, coords)
shopExploitCheck = shopExploitCheck or {}
shopExploitCheck[name] = shopExploitCheck[name] or {}
if isStarted("jim-shops") then
-- Add support for new jim-shops registration export
if checkExportExists("jim-shops", "registerShop") then
exports["jim-shops"]:registerShop(name, label, items, society, coords)
end
end
for i = 1, #InvFunc do
local inv = InvFunc[i]
if isStarted(inv.invName) then

View File

@@ -33,7 +33,7 @@ local targetFunc = {
canInteract = opts[i].canInteract or nil,
}
end
exports[OXTargetExport]:addLocalEntity(entity, options)
return exports[OXTargetExport]:addLocalEntity(entity, options)
end,
boxTarget =
@@ -105,7 +105,7 @@ local targetFunc = {
canInteract = opts[i].canInteract or nil,
}
end
exports[OXTargetExport]:addModel(models, options)
return exports[OXTargetExport]:addModel(models, options)
end,
removeTargetEntity =
@@ -128,7 +128,7 @@ local targetFunc = {
entityTarget =
function(entity, opts, dist)
local options = { options = opts, distance = dist }
exports[QBTargetExport]:AddTargetEntity(entity, options)
return exports[QBTargetExport]:AddTargetEntity(entity, options)
end,
boxTarget =
@@ -148,7 +148,7 @@ local targetFunc = {
modelTarget =
function(models, opts, dist)
local options = { options = opts, distance = dist }
exports[QBTargetExport]:AddTargetModel(models, options)
return exports[QBTargetExport]:AddTargetModel(models, options)
end,
removeTargetEntity =
@@ -213,11 +213,10 @@ local targetFunc = {
-- Tables for storing created targets for the fallback system and zone management.
local TextTargets = {} -- For fallback DrawText3D targets.
local targetEntities = {} -- For entity targets.
local boxTargets = {} -- For box-shaped zone targets.
local circleTargets = {} -- For circular zone targets.
local modelTargets = {}
-------------------------------------------------------------
-- Entity Target Creation
-------------------------------------------------------------
@@ -442,7 +441,7 @@ function createModelTarget(models, opts, dist)
if isStarted(script.targetName) then
debugPrint("^6Bridge^7: ^2Creating new ^3Model ^2target with ^6"..script.targetName.."^7")
local target = script.modelTarget(models, opts, dist)
circleTargets[#circleTargets + 1] = target
modelTargets[#modelTargets + 1] = target
return target
end
end
@@ -553,7 +552,7 @@ local function CleanupTargets()
if isStarted(OXTargetExport) then
exports[OXTargetExport]:removeZone(boxTargets[i], true)
elseif isStarted(QBTargetExport) then
exports[QBTargetExport]:RemoveZone(boxTargets[i].name)
exports[QBTargetExport]:RemoveZone(boxTargets[i])
end
end
-- Remove circle zone targets.
@@ -561,7 +560,7 @@ local function CleanupTargets()
if isStarted(OXTargetExport) then
exports[OXTargetExport]:removeZone(circleTargets[i], true)
elseif isStarted(QBTargetExport) then
exports[QBTargetExport]:RemoveZone(circleTargets[i].name)
exports[QBTargetExport]:RemoveZone(circleTargets[i])
end
end
end