Consistant quickinv sorting
This commit is contained in:
parent
f838453a15
commit
191c456942
|
@ -40,6 +40,7 @@ concommand.Add("benny_debug_give", function(ply, cmd, args)
|
|||
Ammo1 = class.Ammo,
|
||||
Ammo2 = class.Ammo,
|
||||
Ammo3 = class.Ammo,
|
||||
Acquisition = CurTime(),
|
||||
}
|
||||
|
||||
inv[str] = item
|
||||
|
|
|
@ -67,9 +67,10 @@ do
|
|||
[6] = {},
|
||||
[7] = {},
|
||||
}
|
||||
local inv = self:INV_Get()
|
||||
for i, bucket in ipairs( inventorylist ) do
|
||||
local temp = {}
|
||||
for id, data in pairs( self:INV_Get() ) do
|
||||
for id, data in pairs( inv ) do
|
||||
local idata = WEAPONS[data.Class]
|
||||
local translated = translat[idata.Type]
|
||||
|
||||
|
@ -77,7 +78,7 @@ do
|
|||
table.insert( temp, { id, translated[2] } )
|
||||
end
|
||||
end
|
||||
table.sort( temp, function(a, b) return b[2] > a[2] end )
|
||||
table.sort( temp, function(a, b) return (inv[b[1]]["Acquisition"] + (b[2]*10000)) > (inv[a[1]]["Acquisition"] + (a[2]*10000)) end )
|
||||
for i, v in ipairs( temp ) do
|
||||
table.insert( bucket, v[1] )
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue