comparison Main.lua @ 415:837a3a525a76 6.0.3-7

And fixed new CHAT_LOOT_x timer system to work properly.
author MMOSimca <MMOSimca@gmail.com>
date Sun, 04 Jan 2015 13:27:18 -0500
parents d97e37b1e239
children 929d2b27a087
comparison
equal deleted inserted replaced
414:d97e37b1e239 415:837a3a525a76
1559 } 1559 }
1560 1560
1561 1561
1562 local CHAT_MSG_LOOT_UPDATE_FUNCS = { 1562 local CHAT_MSG_LOOT_UPDATE_FUNCS = {
1563 [AF.ITEM] = function(item_id, quantity) 1563 [AF.ITEM] = function(item_id, quantity)
1564 local container_id = current_loot.identifier -- For faster access, since this is going to be called 9 times in the next 3 lines 1564 local container_id = chat_loot_data.identifier -- For faster access, since this is going to be called 9 times in the next 3 lines
1565 -- Verify that we're still assigning data to the right items 1565 -- Verify that we're still assigning data to the right items
1566 if container_id and (private.CONTAINER_ITEM_ID_LIST[container_id] ~= nil) then 1566 if container_id and (private.CONTAINER_ITEM_ID_LIST[container_id] ~= nil) then
1567 Debug("CHAT_MSG_LOOT: AF.ITEM %d (%d)", item_id, quantity) 1567 Debug("CHAT_MSG_LOOT: AF.ITEM %d (%d)", item_id, quantity)
1568 current_loot.sources[container_id] = current_loot.sources[container_id] or {} 1568 chat_loot_data.sources[container_id] = chat_loot_data.sources[container_id] or {}
1569 current_loot.sources[container_id][item_id] = (current_loot.sources[container_id][item_id] or 0) + quantity 1569 chat_loot_data.sources[container_id][item_id] = (chat_loot_data.sources[container_id][item_id] or 0) + quantity
1570 else -- If not, cancel the timer and wipe the loot table early 1570 else -- If not, cancel the timer and wipe the loot table early
1571 Debug("CHAT_MSG_LOOT: We would have assigned the wrong loot!") 1571 Debug("CHAT_MSG_LOOT: We would have assigned the wrong loot!")
1572 ClearChatLootData() 1572 ClearChatLootData()
1573 end 1573 end
1574 end, 1574 end,