Prevent slot list creation every function run

(fixes #5)
This commit is contained in:
Andrew Tomaka 2021-02-21 12:26:11 -05:00
parent 42f27f355d
commit 190e7a016a
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE

View file

@ -34,6 +34,10 @@ MyAddon.taunts = {
[1161] = true, -- Challenging Shout
[204079] = true -- Final Stand
}
MyAddon.slots = {
"HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot",
"WaistSlot", "LegsSlot", "FeetSlot", "MainHandSlot", "SecondaryHandSlot"
}
function MyAddon.OnEvent(self, event, ...)
events[event](self, ...)
@ -137,13 +141,8 @@ function MyAddon.activateGoliath()
end
function MyAddon.needsRepair()
local slots = {
"HeadSlot", "ShoulderSlot", "ChestSlot", "WristSlot", "HandsSlot",
"WaistSlot", "LegsSlot", "FeetSlot", "MainHandSlot", "SecondaryHandSlot"
}
for slot = 1, #slots do
local id = GetInventorySlotInfo(slots[slot])
for slot = 1, #MyAddon.slots do
local id = GetInventorySlotInfo(MyAddon.slots[slot])
local cur, max = GetInventoryItemDurability(id)
if max and cur ~= max then return true end