changeset 240:24e71ed0a422

Added a default for when no addon was selected. Scanner is now disabled when the item count addon returns an error code.
author Zerotorescue
date Sat, 12 Feb 2011 20:15:31 +0100
parents b210cb2b0798
children 65a9ef84d18f
files Modules/Config.lua Modules/Scanner.lua
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Modules/Config.lua	Wed Feb 09 21:53:26 2011 +0100
+++ b/Modules/Config.lua	Sat Feb 12 20:15:31 2011 +0100
@@ -726,6 +726,8 @@
 									if preferedAddon ~= selectedAddonName then
 										t = t .. "\n\n|cffff0000You have selected |cfffed000" .. preferedAddon .. "|r|cffff0000 as your item count addon, but this appears to be disabled and thus the best alternative was selected.|r";
 									end
+								else
+									t = t .. "|cffff0000Warning! No item count addon detected!|r";
 								end
 								
 								return t;
@@ -1740,6 +1742,8 @@
 								if preferedAddon ~= selectedAddonName then
 									t = t .. "\n\n|cffff0000You have selected |cfffed000" .. preferedAddon .. "|r|cffff0000 as your item count addon, but this appears to be disabled and thus the best alternative was selected.|r";
 								end
+							else
+								t = t .. "|cffff0000Warning! No item count addon detected!|r";
 							end
 							
 							return t;
--- a/Modules/Scanner.lua	Wed Feb 09 21:53:26 2011 +0100
+++ b/Modules/Scanner.lua	Sat Feb 12 20:15:31 2011 +0100
@@ -381,6 +381,12 @@
 					-- When restocking use the global item count, when refilling use the local
 					local currentItemCount = ((isRestock and addon:GetItemCount(itemId, groupName)) or addon:GetLocalItemCount(itemId, groupName));
 					
+					if currentItemCount < 0 then
+						addon:Print("Inventorium auto refill from storage could not be executed; no valid item count addon detected.", addon.Colors.Red);
+						
+						return;
+					end
+					
 					-- Check if we have enough items local (but only do so if this location also has enough available)
 					local missingItems = (requiredItems - currentItemCount);