update
This commit is contained in:
@@ -76,6 +76,44 @@ local function mergeByList(baseByList, extraByList)
|
||||
return merged
|
||||
end
|
||||
|
||||
local function isMagazineType(itemType)
|
||||
local s = tostring(itemType or ""):lower()
|
||||
if s == "" then
|
||||
return false
|
||||
end
|
||||
if s:sub(1, 10) == "base.clip_" then
|
||||
return true
|
||||
end
|
||||
if s:find("magazine", 1, true) then
|
||||
return true
|
||||
end
|
||||
if s:find("drum", 1, true) then
|
||||
return true
|
||||
end
|
||||
if s:find("clip", 1, true) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function collectMagazines(values)
|
||||
local out = {}
|
||||
local seen = {}
|
||||
if type(values) ~= "table" then
|
||||
return out
|
||||
end
|
||||
for _, value in ipairs(values) do
|
||||
if isMagazineType(value) then
|
||||
local key = tostring(value):lower()
|
||||
if not seen[key] then
|
||||
seen[key] = true
|
||||
out[#out + 1] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
local defaults = safeRequire("OFBlockRules_Default")
|
||||
local user = safeRequire("OFBlockRules_User")
|
||||
local sourceCatalog = safeRequire("OFSourceCatalog")
|
||||
@@ -83,6 +121,7 @@ local sourceCatalog = safeRequire("OFSourceCatalog")
|
||||
local aliasCatalog = {
|
||||
firearms = sourceCatalog.firearms or {},
|
||||
attachments = sourceCatalog.attachments or {},
|
||||
magazines = sourceCatalog.magazines or collectMagazines(sourceCatalog.attachments),
|
||||
ggs_all = sourceCatalog.ggs_all or {},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
-- Auto-generated by tools/ggs-dist-cli.js apply
|
||||
-- Keep this empty template in git; generated content can overwrite it.
|
||||
-- Generated at: 2026-02-12T19:59:03.395Z
|
||||
return {
|
||||
items = {},
|
||||
items = {
|
||||
["Base.12GClip"] = {
|
||||
enabled = false,
|
||||
placements = {
|
||||
["ArmyStorageAmmunition"] = 1,
|
||||
["ArmyStorageGuns"] = 1,
|
||||
},
|
||||
},
|
||||
["Base.1P78"] = {
|
||||
enabled = false,
|
||||
placements = {
|
||||
["ArmyStorageAmmunition"] = 1,
|
||||
["ArmyStorageGuns"] = 1,
|
||||
},
|
||||
},
|
||||
["Base.9mmClip"] = {
|
||||
enabled = false,
|
||||
placements = {
|
||||
["GunStoreMagsAmmo"] = 1,
|
||||
["PoliceStorageGuns"] = 1,
|
||||
},
|
||||
},
|
||||
["Base.A2000"] = {
|
||||
enabled = true,
|
||||
placements = {
|
||||
["ArmyStorageAmmunition"] = 1,
|
||||
["ArmyStorageGuns"] = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user