Mercurial > wow > wowdb-profiler
comparison Main.lua @ 410:ad8323486561
Added support for more item containers without loot windows. Improved conditional statements related to item handling.
author | MMOSimca <MMOSimca@gmail.com> |
---|---|
date | Fri, 02 Jan 2015 02:56:25 -0500 |
parents | da20cca2ddc6 |
children | 4adc1fa4ddba |
comparison
equal
deleted
inserted
replaced
409:78a2e8928a34 | 410:ad8323486561 |
---|---|
573 end | 573 end |
574 end | 574 end |
575 end | 575 end |
576 end | 576 end |
577 | 577 |
578 if not bag_index or not slot_index then | 578 local any_loot = false |
579 return | 579 |
580 end | 580 -- Check if Blizzard has marked this item has officially having a chance of containing loot |
581 local _, _, _, _, _, is_lootable = _G.GetContainerItemInfo(bag_index, slot_index) | 581 if bag_index and slot_index then |
582 | 582 local _, _, _, _, _, is_lootable = _G.GetContainerItemInfo(bag_index, slot_index) |
583 if not is_lootable and not private.CONTAINER_ITEM_ID_LIST[item_id] then | 583 if is_lootable then |
584 return | 584 any_loot = true |
585 end | 585 end |
586 | 586 end |
587 table.wipe(current_action) | 587 |
588 current_loot = nil | 588 -- Check if we've marked this item as one Blizzard provides bad is_lootable data for |
589 current_action.target_type = AF.ITEM | 589 if private.CONTAINER_ITEM_ID_LIST[item_id] ~= nil then |
590 current_action.identifier = item_id | 590 any_loot = true |
591 current_action.loot_label = "contains" | 591 end |
592 | 592 |
593 -- For items that open instantly with no spell cast | 593 if any_loot then |
594 if _G.GetNumLootItems() == 0 and private.CONTAINER_ITEM_ID_LIST[item_id] == true then | 594 table.wipe(current_action) |
595 ClearChatLootData() | 595 current_loot = nil |
596 Debug("HandleItemUse: Beginning chat-based loot timer for item with ID %d.", item_id) | 596 current_action.target_type = AF.ITEM |
597 chat_loot_timer_handle = C_Timer.NewTimer(1, ClearChatLootData) | 597 current_action.identifier = item_id |
598 InitializeCurrentLoot() | 598 current_action.loot_label = "contains" |
599 | |
600 -- For items that open instantly with no spell cast | |
601 if (private.CONTAINER_ITEM_ID_LIST[item_id] == true) and ((not _G.GetNumLootItems()) or (_G.GetNumLootItems() == 0)) then | |
602 ClearChatLootData() | |
603 Debug("HandleItemUse: Beginning chat-based loot timer for item with ID %d.", item_id) | |
604 chat_loot_timer_handle = C_Timer.NewTimer(1, ClearChatLootData) | |
605 InitializeCurrentLoot() | |
606 end | |
599 end | 607 end |
600 | 608 |
601 --[[DatamineTT:ClearLines() | 609 --[[DatamineTT:ClearLines() |
602 DatamineTT:SetBagItem(bag_index, slot_index) | 610 DatamineTT:SetBagItem(bag_index, slot_index) |
603 | 611 |