diff Modules/Scanner.lua @ 89:a12d22ef3f39

AceSerializer has been enabled again as it?s used when exporting/importing groups. All other unused libraries are now really removed. Adjusted debug function to format only when a debug channel is available. Fixed moving from guild banks, checking if items are locked is different then with banks. Now unregistering the item locking event so it doesn?t continue to try to move every time an item is switched after the automated cycle has finished. (geeezus, this description is a total overkill) Fixed item queueing. Queue all when there?s a group without any items inside no longer crashes. Removing cached container data after closing a container.
author Zerotorescue
date Fri, 07 Jan 2011 22:19:03 +0100
parents 3bec0ea44607
children 31493364b163
line wrap: on
line diff
--- a/Modules/Scanner.lua	Fri Jan 07 10:34:38 2011 +0100
+++ b/Modules/Scanner.lua	Fri Jan 07 22:19:03 2011 +0100
@@ -15,10 +15,10 @@
 end
 
 function mod:CacheLocation(location, remember)
+	-- Reset cache just in case it was filled
+	self:ClearCache();
+	
 	if location == addon.Locations.Bag or location == addon.Locations.Bank then
-		-- Reset cache just in case it was filled
-		self:ClearCache();
-		
 		local start, stop;
 		if location == addon.Locations.Bag then
 			start = 0;
@@ -60,9 +60,6 @@
 			end
 		end
 	elseif location == addon.Locations.Guild then
-		-- Reset cache before we scan
-		self:ClearCache();
-		
 		for tabId = 1, GetNumGuildBankTabs() do
 			local isViewable = select(3, GetGuildBankTabInfo(tabId));
 			
@@ -190,6 +187,8 @@
 function mod:BANKFRAME_CLOSED()
 	addon:Debug("Scanner:BANKFRAME_CLOSED");
 	
+	self:ClearCache();
+	
 	mod:UnregisterEvent("BANKFRAME_CLOSED");
 	
 	StaticPopup_Hide("InventoriumRefill");
@@ -208,7 +207,7 @@
 
 function mod:DoScanGuild()
 	if not scanned then
-		addon:Debug("Scanner:GUILDBANKBAGSLOTS_CHANGED");
+		addon:Debug("Scanner:DoScanGuild");
 		
 		scanned = true;
 		
@@ -220,6 +219,7 @@
 	addon:Debug("Scanner:GUILDBANKFRAME_CLOSED");
 	
 	scanned = nil;
+	self:ClearCache();
 	
 	self:UnregisterEvent("GUILDBANKFRAME_CLOSED");
 	self:UnregisterEvent("GUILDBANKBAGSLOTS_CHANGED");