diff core.lua @ 34:f1d0a5d7b006

Manual loot insertion should not go through recent cache.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Wed, 07 Dec 2011 08:27:58 +0000
parents 47949f8eb783
children f75329fe5758
line wrap: on
line diff
--- a/core.lua	Fri Dec 02 01:59:31 2011 +0000
+++ b/core.lua	Wed Dec 07 08:27:58 2011 +0000
@@ -671,6 +671,7 @@
 		-- The function name is a bit of a misnomer, as local entries overwrite
 		-- remote entries as the candidate table is populated.  This routine is
 		-- to extract the results once the cache timers have expired.
+		-- Keep this sync'd with the local_override branch below.
 		for i,sig in ipairs(candidates) do
 			addon.dprint('loot', "processing candidate entry", i, sig)
 			local loot = candidates[sig]
@@ -719,7 +720,6 @@
 			if from and self.recent_loot:test(signature) then
 				self.dprint('cache', "loot <",signature,"> already in cache, skipping")
 			else
-				self.recent_loot:add(signature)
 				-- There is some redundancy in all this, in the interests of ease-of-coding
 				i = {
 					kind		= 'loot',
@@ -737,9 +737,28 @@
 					extratext	= extratext,
 					is_heroic	= self:is_heroic_item(ilink),
 				}
-				candidates[signature] = i
-				tinsert (candidates, signature)
-				self.dprint('cache', "loot <",signature,"> added to cache, candidate", #candidates)
+				if local_override then
+					-- adding things by hand, don't wait for network cache timeouts
+					if i.extratext == 'shard'
+					   or i.extratext == 'gvault'
+					   or i.extratext == 'offspec'
+					then
+						i.disposition = i.extratext
+					end
+					local looti = self._addLootEntry(i)
+					if (i.disposition ~= 'shard')
+					   and (i.disposition ~= 'gvault')
+					   and (not self.history_suppress)
+					then
+						self:_addHistoryEntry(looti)
+					end
+					i = looti  -- mostly for gui's manual entry
+				else
+					self.recent_loot:add(signature)
+					candidates[signature] = i
+					tinsert (candidates, signature)
+					self.dprint('cache', "loot <",signature,"> added to cache, candidate", #candidates)
+				end
 			end
 			break
 		end