Mercurial > wow > ouroloot
comparison core.lua @ 42:4f1e71f62776
Handle moving from one instance kill/loot into a new instance, and then getting loot from trash in the new instance before seeing any bosses.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Fri, 13 Jan 2012 01:12:36 +0000 |
parents | d6b8858c1b64 |
children | a561a967b5e6 |
comparison
equal
deleted
inserted
replaced
41:d6b8858c1b64 | 42:4f1e71f62776 |
---|---|
280 t = t .. "h" | 280 t = t .. "h" |
281 end | 281 end |
282 return name .. "(" .. t .. ")" | 282 return name .. "(" .. t .. ")" |
283 end | 283 end |
284 addon.instance_tag = instance_tag -- grumble | 284 addon.instance_tag = instance_tag -- grumble |
285 addon.latest_instance = nil -- spelling reminder, assigned elsewhere | |
285 | 286 |
286 | 287 |
287 ------ Expiring caches | 288 ------ Expiring caches |
288 --[[ | 289 --[[ |
289 foo = create_new_cache("myfoo",15[,cleanup]) -- ttl | 290 foo = create_new_cache("myfoo",15[,cleanup]) -- ttl |
693 end | 694 end |
694 end | 695 end |
695 | 696 |
696 -- helper for CHAT_MSG_LOOT handler | 697 -- helper for CHAT_MSG_LOOT handler |
697 do | 698 do |
699 local function maybe_trash_kill_entry() | |
700 -- this is set on various boss interactions, so we've got a kill/wipe | |
701 -- entry already | |
702 if addon.latest_instance then return end | |
703 addon.latest_instance = instance_tag() | |
704 addon:_mark_boss_kill (addon._addLootEntry{ | |
705 kind='boss',reason='kill',bosskill=[[trash]],instance=addon.latest_instance,duration=0 | |
706 }) | |
707 end | |
708 | |
698 -- Recent loot cache | 709 -- Recent loot cache |
699 local candidates = {} | 710 local candidates = {} |
700 local function prefer_local_loots (cache) | 711 local function prefer_local_loots (cache) |
701 -- The function name is a bit of a misnomer, as local entries overwrite | 712 -- The function name is a bit of a misnomer, as local entries overwrite |
702 -- remote entries as the candidate table is populated. This routine is | 713 -- remote entries as the candidate table is populated. This routine is |
706 for i,sig in ipairs(candidates) do | 717 for i,sig in ipairs(candidates) do |
707 addon.dprint('loot', "processing candidate entry", i, sig) | 718 addon.dprint('loot', "processing candidate entry", i, sig) |
708 local loot = candidates[sig] | 719 local loot = candidates[sig] |
709 if loot then | 720 if loot then |
710 addon.dprint('loot', i, "was found") | 721 addon.dprint('loot', i, "was found") |
722 maybe_trash_kill_entry() -- Generate *some* kind of boss/location entry | |
711 candidates[sig] = nil | 723 candidates[sig] = nil |
712 local looti = addon._addLootEntry(loot) | 724 local looti = addon._addLootEntry(loot) |
713 if (loot.disposition ~= 'shard') | 725 if (loot.disposition ~= 'shard') |
714 and (loot.disposition ~= 'gvault') | 726 and (loot.disposition ~= 'gvault') |
715 and (not addon.history_suppress) | 727 and (not addon.history_suppress) |
1262 end | 1274 end |
1263 bossi = addon._addLootEntry(boss) | 1275 bossi = addon._addLootEntry(boss) |
1264 -- addon. | 1276 -- addon. |
1265 bossi = addon._adjustBossOrder (bossi, g_boss_signpost) or bossi | 1277 bossi = addon._adjustBossOrder (bossi, g_boss_signpost) or bossi |
1266 g_boss_signpost = nil | 1278 g_boss_signpost = nil |
1279 addon.latest_instance = boss.instance | |
1267 addon.dprint('loot', "added boss entry", bossi) | 1280 addon.dprint('loot', "added boss entry", bossi) |
1268 if boss.reason == 'kill' then | 1281 if boss.reason == 'kill' then |
1269 addon:_mark_boss_kill (bossi) | 1282 addon:_mark_boss_kill (bossi) |
1270 if opts.chatty_on_kill then | 1283 if opts.chatty_on_kill then |
1271 addon:Print("Registered kill for '%s' in %s!", boss.bosskill, boss.instance) | 1284 addon:Print("Registered kill for '%s' in %s!", boss.bosskill, boss.instance) |