comparison Main.lua @ 395:930da8078de7 6.0.3-1

Increased reliability of chat-based loot data and fixed two critical bugs with bonus ID parsing.
author MMOSimca <MMOSimca@gmail.com>
date Fri, 19 Dec 2014 15:54:50 -0500
parents 7d0ad2573092
children 792320b3fc4d
comparison
equal deleted inserted replaced
394:a30c251ad382 395:930da8078de7
591 current_action.target_type = AF.ITEM 591 current_action.target_type = AF.ITEM
592 current_action.identifier = item_id 592 current_action.identifier = item_id
593 current_action.loot_label = "contains" 593 current_action.loot_label = "contains"
594 594
595 -- For items that open instantly with no spell cast 595 -- For items that open instantly with no spell cast
596 if private.CONTAINER_ITEM_ID_LIST[item_id] == true then 596 if (not _G.GetNumLootItems()) and (private.CONTAINER_ITEM_ID_LIST[item_id] == true) then
597 ClearChatLootData() 597 ClearChatLootData()
598 Debug("HandleItemUse: Beginning chat-based loot timer for item with ID %d.", item_id) 598 Debug("HandleItemUse: Beginning chat-based loot timer for item with ID %d.", item_id)
599 chat_loot_timer_handle = C_Timer.NewTimer(1, ClearChatLootData) 599 chat_loot_timer_handle = C_Timer.NewTimer(1, ClearChatLootData)
600 InitializeCurrentLoot() 600 InitializeCurrentLoot()
601 end 601 end
1105 else 1105 else
1106 sorted_bonus_string = sorted_bonus_string .. ":" .. tostring(min_bonus_id) 1106 sorted_bonus_string = sorted_bonus_string .. ":" .. tostring(min_bonus_id)
1107 end 1107 end
1108 end 1108 end
1109 1109
1110 item.seen_bonuses[sorted_bonus_string] = true
1110 Debug("RecordItemData: Recorded bonus IDs %s for item %d.", sorted_bonus_string, item_id) 1111 Debug("RecordItemData: Recorded bonus IDs %s for item %d.", sorted_bonus_string, item_id)
1111 else 1112 else
1112 Debug("RecordItemData: num_bonus_ids is supposed to be 0 or positive, instead it was %d.", num_bonus_ids) 1113 Debug("RecordItemData: num_bonus_ids is supposed to be 0 or positive, instead it was %d.", num_bonus_ids)
1113 end 1114 end
1114 if upgrade_id and upgrade_id ~= 0 then 1115 if upgrade_id and upgrade_id ~= 0 then
1590 category = AF.NPC 1591 category = AF.NPC
1591 elseif chat_loot_timer_handle then 1592 elseif chat_loot_timer_handle then
1592 category = AF.ITEM 1593 category = AF.ITEM
1593 end 1594 end
1594 1595
1596 -- We still want to record the item's data, even if it doesn't need its drop location recorded
1597 RecordItemData(item_id, item_link, true)
1598
1595 -- Take action based on update category 1599 -- Take action based on update category
1596 local update_func = CHAT_MSG_LOOT_UPDATE_FUNCS[category] 1600 local update_func = CHAT_MSG_LOOT_UPDATE_FUNCS[category]
1597 if not category or not update_func then 1601 if not category or not update_func then
1598 -- We still want to record the item's data, even if it doesn't need its drop location recorded
1599 RecordItemData(item_id, item_link, true)
1600 return 1602 return
1601 end 1603 end
1602 update_func(item_id, quantity) 1604 update_func(item_id, quantity)
1603 end 1605 end
1604 end 1606 end
2026 -- Prevent opening the same loot window multiple times from recording data multiple times. 2028 -- Prevent opening the same loot window multiple times from recording data multiple times.
2027 local loot_guid_registry = {} 2029 local loot_guid_registry = {}
2028 2030
2029 2031
2030 function WDP:LOOT_CLOSED(event_name) 2032 function WDP:LOOT_CLOSED(event_name)
2033 if chat_loot_timer_handle then
2034 ClearChatLootData()
2035 end
2031 current_loot = nil 2036 current_loot = nil
2032 table.wipe(current_action) 2037 table.wipe(current_action)
2033 end 2038 end
2034 2039
2035 2040