Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New house console error fix #252

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ local function SetClosestHouse()
end, ClosestHouse)
end
end

if next(Config.Houses[ClosestHouse].garage) == nil then return end
TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey)
if Config.Houses[ClosestHouse] and Config.Houses[ClosestHouse].garage then
TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey)
end
end

local function setHouseLocations()
Expand Down Expand Up @@ -1086,8 +1086,9 @@ AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
if Config.UnownedBlips then TriggerEvent('qb-houses:client:setupHouseBlips2') end
Wait(100)
TriggerServerEvent('qb-houses:server:setHouses')
if next(Config.Houses[ClosestHouse].garage) == nil then return end
TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey)
if Config.Houses[ClosestHouse] and Config.Houses[ClosestHouse].garage then
TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey)
end
end)

RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
Expand Down Expand Up @@ -1526,7 +1527,7 @@ CreateThread(function()
TriggerEvent('qb-houses:client:setupHouseBlips2')
end
Wait(wait)
if ClosestHouse and next(Config.Houses[ClosestHouse].garage) ~= nil then
if ClosestHouse and Config.Houses[ClosestHouse] and Config.Houses[ClosestHouse].garage then
TriggerEvent('qb-garages:client:setHouseGarage', ClosestHouse, HasHouseKey)
end
TriggerServerEvent('qb-houses:server:setHouses')
Expand Down
Loading