Skip to content

Commit

Permalink
fix: canAccess function runs only on server
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason committed Jul 4, 2024
1 parent e22346c commit b8df29b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ local function checkCanAccess(garage)
exports.qbx_core:Notify(locale('error.no_access'), 'error')
return false
end
if garage.canAccess ~= nil and not garage.canAccess() then
exports.qbx_core:Notify(locale('error.no_access'), 'error')
return false
end
if cache.vehicle and not isOfType(garage.vehicleType, cache.vehicle) then
exports.qbx_core:Notify(locale('error.not_correct_type'), 'error')
return false
Expand Down
2 changes: 1 addition & 1 deletion config/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ return {
---@field shared? boolean defaults to false. Shared garages give all players with access to the garage access to all vehicles in it. If shared is off, the garage will only give access to player's vehicles which they own.
---@field states? VehicleState | VehicleState[] if set, only vehicles in the given states will be retrievable from the garage. Defaults to GARAGED.
---@field skipGarageCheck? boolean if true, returns vehicles for retrieval regardless of if that vehicle's garage matches this garage's name
---@field canAccess? fun(source?: number): boolean runs on both client & server to check access as an additional guard clause. Other filter fields still need to pass in addition to this function.
---@field canAccess? fun(source: number): boolean checks access as an additional guard clause. Other filter fields still need to pass in addition to this function.
---@field accessPoints AccessPoint[]

---@type table<string, GarageConfig>
Expand Down

0 comments on commit b8df29b

Please sign in to comment.