# HG changeset patch # User Zerotorescue # Date 1297538131 -3600 # Node ID 24e71ed0a4226d3ce15e7255bb283b471368b710 # Parent b210cb2b0798cbbe9aa898147827ddf94963afc0 Added a default for when no addon was selected. Scanner is now disabled when the item count addon returns an error code. diff -r b210cb2b0798 -r 24e71ed0a422 Modules/Config.lua --- 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; diff -r b210cb2b0798 -r 24e71ed0a422 Modules/Scanner.lua --- 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);