17,097
edits
(Update for v0.21) |
(_getItemUses: Only iterate over slayer areas for equipment) |
||
Line 106: | Line 106: | ||
-- Check if the item is an entry requirement for any Slayer area | -- Check if the item is an entry requirement for any Slayer area | ||
local isSlayerAreaReq = false | local isSlayerAreaReq = false | ||
local slayerAreas = Areas.getAreas(function(area) return area.type == 'slayer' end) | if item.isEquipment then | ||
local slayerAreas = Areas.getAreas(function(area) return area.type == 'slayer' end) | |||
for i, area in pairs(slayerAreas) do | |||
if area.entryRequirements ~= nil and type(area.entryRequirements) == 'table' then | |||
for j, req in pairs(area.entryRequirements) do | |||
if req.type == "SlayerItem" and req.itemID == item.id then | |||
isSlayerAreaReq = true | |||
break | |||
end | |||
end | end | ||
if isSlayerAreaReq then break end | |||
end | end | ||
end | end | ||
end | end |