Clean up code
This commit is contained in:
parent
1c9463be2c
commit
60ad7436b9
|
@ -47,9 +47,9 @@ local function scanAllBags(delayed)
|
|||
end
|
||||
local function bagLoop(id, res)
|
||||
local units = child:GetNamespace('units')
|
||||
local playerID = child.getPID()
|
||||
for k, v in pairs(modul['db']) do
|
||||
if(units[k]) then
|
||||
local playerID = child.getPID()
|
||||
if(playerID and units[k]['faction'] == units[playerID]['faction']) then
|
||||
local unitname = units[k]['name']
|
||||
for bag, list in pairs(v) do
|
||||
|
|
|
@ -77,18 +77,14 @@ local function scanAllBankBags(delayed)
|
|||
end
|
||||
local function bagLoop(id, res)
|
||||
local dName = desc
|
||||
local units = child:GetNamespace('units')
|
||||
local playerID = child.getPID()
|
||||
for k,v in pairs(modul['db']) do
|
||||
local units = child:GetNamespace('units')
|
||||
if(units[k]) then
|
||||
local playerID = child.getPID()
|
||||
if(playerID and units[k]['faction'] == units[playerID]['faction']) then
|
||||
local unitname = units[k]['name']
|
||||
for bag, list in pairs(v) do
|
||||
if(bag == -3) then
|
||||
dName = 'reagentCount'
|
||||
else
|
||||
dName = desc
|
||||
end
|
||||
dName = bag == -3 and 'reagentCount' or desc
|
||||
for a, b in pairs(list) do
|
||||
if(a == id) then
|
||||
res[unitname] = res[unitname] or {
|
||||
|
|
Loading…
Reference in New Issue