From abebc8dba1fc4e692529a3996844437ea7572736 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Tue, 9 Nov 2010 08:19:38 -0500 Subject: [PATCH] -Fixed a slight issue with guild count was being displayed and added twice. -It should display correctly if using /bgs guild and /bgs guildname. --- BagSync.lua | 9 +++++---- BagSync.toc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/BagSync.lua b/BagSync.lua index 1055dd1..63e5953 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -911,7 +911,7 @@ hooksecurefunc("BackpackTokenFrame_Update", BagSync.ScanTokens) local function CountsToInfoString(invCount, bankCount, equipCount, guildCount, mailboxCount) local info - local total = invCount + bankCount + equipCount + guildCount + mailboxCount + local total = invCount + bankCount + equipCount + mailboxCount if invCount > 0 then info = L["Bags: %d"]:format(invCount) @@ -936,6 +936,7 @@ local function CountsToInfoString(invCount, bankCount, equipCount, guildCount, m end if guildCount > 0 and BagSyncOpt.enableGuild and not BagSyncOpt.showGuildNames then + total = total + guildCount --add the guild count only if we don't have showguildnames on, otherwise it's counted twice local count = L["Guild: %d"]:format(guildCount) if info then info = strjoin(', ', info, count) @@ -1087,9 +1088,9 @@ local function AddOwners(frame, link) --get class for the unit if there is one local pClass = v["class:0:0"] or nil - infoString = CountsToInfoString(invCount or 0, bankCount or 0, equipCount or 0, guildCount or 0, mailboxCount or 0) - grandTotal = grandTotal + (invCount or 0) + (bankCount or 0) + (equipCount or 0) + (guildCount or 0) + (mailboxCount or 0) - + infoString = CountsToInfoString(invCount, bankCount, equipCount, guildCount, mailboxCount) + grandTotal = grandTotal + invCount + bankCount + equipCount + guildCount + mailboxCount + if infoString and infoString ~= '' then frame:AddDoubleLine(getNameColor(k, pClass), infoString) table.insert(lastDisplayed, getNameColor(k or 'Unknown', pClass).."@"..(infoString or 'unknown')) diff --git a/BagSync.toc b/BagSync.toc index 6bf5744..edb7556 100644 --- a/BagSync.toc +++ b/BagSync.toc @@ -2,7 +2,7 @@ ## Title: BagSync ## Notes: BagSync tracks your characters items and displays it within tooltips. ## Author: Xruptor -## Version: 5.4 +## Version: 5.4.1 ## SavedVariables: BagSyncDB, BagSyncOpt, BagSyncGUILD_DB, BagSyncTOKEN_DB localization\localization.lua -- 1.7.9.5