Skip to content

Commit

Permalink
Merge pull request #250 from Qwerty1Verified/patch-2
Browse files Browse the repository at this point in the history
fix: Prevent garages being updated if no garage set
  • Loading branch information
GhzGarage authored Jul 1, 2024
2 parents ddbd448 + 7f499b4 commit 897d7e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1083,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()
Expand Down Expand Up @@ -1523,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
Expand Down

0 comments on commit 897d7e7

Please sign in to comment.