From d141826380e2aabb95141980dc30019309121e9a Mon Sep 17 00:00:00 2001 From: Joel <34402846+Qwerty1Verified@users.noreply.github.com> Date: Fri, 28 Jun 2024 04:27:25 +0100 Subject: [PATCH 1/2] fix: Prevent garages being updated if no garage set --- client/main.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/main.lua b/client/main.lua index 282b03d..75ba4d9 100644 --- a/client/main.lua +++ b/client/main.lua @@ -528,6 +528,8 @@ local function SetClosestHouse() end, ClosestHouse) end end + + if next(Config.Houses[ClosestHouse].garage) == nil then return end TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey) end From 7f499b47225ed6a26a3f84dcbcaf143ae737bd1c Mon Sep 17 00:00:00 2001 From: Joel <34402846+Qwerty1Verified@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:21:45 +0100 Subject: [PATCH 2/2] fix: Prevent garages being updated if no garage set Extra checks to other areas of the code where this event is sent on player load or resource start --- client/main.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 75ba4d9..c362aaf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1085,8 +1085,9 @@ AddEventHandler('QBCore:Client:OnPlayerLoaded', function() TriggerEvent('qb-houses:client:setupHouseBlips') if Config.UnownedBlips then TriggerEvent('qb-houses:client:setupHouseBlips2') end Wait(100) - TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey) TriggerServerEvent('qb-houses:server:setHouses') + if next(Config.Houses[ClosestHouse].garage) == nil then return end + TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey) end) RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() @@ -1525,7 +1526,9 @@ CreateThread(function() TriggerEvent('qb-houses:client:setupHouseBlips2') end Wait(wait) - TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey) + if ClosestHouse and next(Config.Houses[ClosestHouse].garage) ~= nil then + TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey) + end TriggerServerEvent('qb-houses:server:setHouses') while true do