Quantcast

-Fixed a bug where ammo was being counted twice. Special thanks to berrybear from WOWInterface.com.

Xruptor [06-21-10 - 12:52]
-Fixed a bug where ammo was being counted twice.  Special thanks to berrybear from WOWInterface.com.
-NOTE: You have to unequip and re-equip your ammo for this to take effect.
Filename
BagSync.lua
diff --git a/BagSync.lua b/BagSync.lua
index c8e7238..76635d0 100644
--- a/BagSync.lua
+++ b/BagSync.lua
@@ -530,7 +530,12 @@ function BagSync:SaveEquipment()
 			count = count > 1 and count or nil

 			if (linkItem and count) then
-				BS_DB[index] = format('%s,%d', linkItem, count)
+				--check for ranged slot ammo, don't add twice
+				if slot == GetInventorySlotInfo("AmmoSlot") and count <= 1 then
+					BS_DB[index] = format('%s,%d', linkItem, count)
+				elseif slot ~= GetInventorySlotInfo("AmmoSlot") then
+					BS_DB[index] = format('%s,%d', linkItem, count)
+				end
 			else
 				BS_DB[index] = linkItem
 			end