refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-09-06 07:43:37 +02:00
parent 00a242e0e2
commit d686b6af59
12 changed files with 71 additions and 74 deletions
+3 -6
View File
@@ -332,7 +332,7 @@ function quantity_update(max_count)
end
function unit_vendor_price(item_key)
for slot in info.inventory do temp=slot
for slot in info.inventory do auto[slot] = true
local item_info = info.container_item(unpack(slot))
if item_info and item_info.item_key == item_key then
if info.auctionable(item_info.tooltip, nil, item_info.lootable) then
@@ -396,7 +396,7 @@ end
function update_inventory_records()
local auctionable_map = tt
for slot in info.inventory do temp=slot
for slot in info.inventory do auto[slot] = true
for item_info in present(info.container_item(unpack(slot))) do
local charge_class = item_info.charges or 0
if info.auctionable(item_info.tooltip, nil, item_info.lootable) then
@@ -427,10 +427,7 @@ function update_inventory_records()
end
end
end
wipe(inventory_records)
for _, auctionable in auctionable_map do
tinsert(inventory_records, auctionable)
end
init[inventory_records] = temp-values(auctionable_map)
sort(inventory_records, function(a, b) return a.name < b.name end)
refresh = true
end