Free atts off actually works

This commit is contained in:
Haodong Mo 2022-12-29 20:21:21 +10:00
parent cfc2276b16
commit 52a61a05b3
14 changed files with 11 additions and 17 deletions

View File

@ -1,16 +1,9 @@
{ {
"title": "ARC9", "title": "ARC9 Weapon Base",
"description": "", "type": "weapon",
"type": "weapon", "tags":
"tags": [ [
"roleplay", "roleplay",
"realism" "realism"
], ]
"ignore": [ }
".git/*",
"README.md",
".py/*",
".blend/*",
".pdn/*"
]
}

View File

@ -51,7 +51,7 @@ function SWEP:CountAttsInTree(tree)
local count = {} local count = {}
for _, i in ipairs(flattree) do for _, i in pairs(flattree[1]) do
if i.Installed then if i.Installed then
local att = i.Installed local att = i.Installed
count[att] = (count[att] or 0) + 1 count[att] = (count[att] or 0) + 1
@ -72,6 +72,7 @@ function SWEP:ReceiveWeapon()
if SERVER then if SERVER then
if !self:ValidateInventoryForNewTree(tbl) then if !self:ValidateInventoryForNewTree(tbl) then
self:SendWeapon()
return return
end end
end end

View File

@ -214,7 +214,7 @@ function SWEP:ValidateInventoryForNewTree(tree)
local currcount = self:CountAttsInTree(self.Attachments) local currcount = self:CountAttsInTree(self.Attachments)
for att, attc in ipairs(count) do for att, attc in pairs(count) do
local atttbl = ARC9.GetAttTable(att) local atttbl = ARC9.GetAttTable(att)
if atttbl.Free then continue end if atttbl.Free then continue end