Skip to content

Commit

Permalink
fix: Prevent garages being updated if no garage set
Browse files Browse the repository at this point in the history
Extra checks to other areas of the code where this event is sent on player load or resource start
  • Loading branch information
Qwerty1Verified authored Jun 29, 2024
1 parent d141826 commit 7f499b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f499b4

Please sign in to comment.