comparison Modules/Scanner.lua @ 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 07263a435f3c
children
comparison
equal deleted inserted replaced
239:b210cb2b0798 240:24e71ed0a422
379 -- Only do all the CPU intensive checks if this item is available 379 -- Only do all the CPU intensive checks if this item is available
380 380
381 -- When restocking use the global item count, when refilling use the local 381 -- When restocking use the global item count, when refilling use the local
382 local currentItemCount = ((isRestock and addon:GetItemCount(itemId, groupName)) or addon:GetLocalItemCount(itemId, groupName)); 382 local currentItemCount = ((isRestock and addon:GetItemCount(itemId, groupName)) or addon:GetLocalItemCount(itemId, groupName));
383 383
384 if currentItemCount < 0 then
385 addon:Print("Inventorium auto refill from storage could not be executed; no valid item count addon detected.", addon.Colors.Red);
386
387 return;
388 end
389
384 -- Check if we have enough items local (but only do so if this location also has enough available) 390 -- Check if we have enough items local (but only do so if this location also has enough available)
385 local missingItems = (requiredItems - currentItemCount); 391 local missingItems = (requiredItems - currentItemCount);
386 392
387 if isRestock and currentItemCount == 0 and bonusQueue and bonusQueue > 0 then 393 if isRestock and currentItemCount == 0 and bonusQueue and bonusQueue > 0 then
388 -- If we have none left and the bonus queue is enabled, modify the amount to be queued 394 -- If we have none left and the bonus queue is enabled, modify the amount to be queued