Skip to content

Commit

Permalink
feat: remove config.vehicles & use the shop field of core shared/vehi…
Browse files Browse the repository at this point in the history
…cles
  • Loading branch information
TonybynMp4 committed Feb 28, 2024
1 parent 6a29e2e commit 10fdf51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3,096 deletions.
13 changes: 8 additions & 5 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ local function openVehCatsMenu(category, targetVehicle)
local vehMenu = {}
for k, v in pairs(VEHICLES) do
if VEHICLES[k].category == category then
if config.vehicles[k] == nil then
lib.print.debug('Vehicle not found in config.vehicles. Skipping: '..k)
elseif type(config.vehicles[k].shop) == 'table' then
for _, shop in pairs(config.vehicles[k].shop) do
if not VEHICLES[k].shop then
lib.print.debug('Vehicle '..k..' does not have a shop set')
goto continue
end

if type(VEHICLES[k].shop) == 'table' then
for _, shop in pairs(VEHICLES[k].shop) do
if shop == insideShop then
vehMenu[#vehMenu + 1] = {
title = v.brand..' '..v.name,
Expand All @@ -197,7 +200,7 @@ local function openVehCatsMenu(category, targetVehicle)
}
end
end
elseif config.vehicles[k].shop == insideShop then
elseif VEHICLES[k].shop == insideShop then
vehMenu[#vehMenu + 1] = {
title = v.brand..' '..v.name,
description = locale('menus.veh_price')..lib.math.groupdigits(v.price),
Expand Down
Loading

0 comments on commit 10fdf51

Please sign in to comment.