From 7ad34c755820a92bba0359fe8e8ef1c068db769e Mon Sep 17 00:00:00 2001 From: Albirew Date: Fri, 27 Sep 2019 15:37:54 +0200 Subject: [PATCH] fixed accountInfo bug in retail fixed "attempt to index local 'accountInfo' (a number value)" --- Modules/BlackBook.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Modules/BlackBook.lua b/Modules/BlackBook.lua index 95f0652..686fd5d 100644 --- a/Modules/BlackBook.lua +++ b/Modules/BlackBook.lua @@ -297,7 +297,12 @@ function Postal_BlackBook:OnChar(editbox, ...) local numBNetTotal, numBNetOnline = BNGetNumFriends() for i = 1, numBNetOnline do local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR = BNGetFriendInfo(i) - if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(toonID)) then + if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then + local accountID = toonID + else + local accountID = C_BattleNet.GetFriendAccountInfo(i) + end + if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(accountID)) then if strfind(strupper(toonName), text, 1, 1) == 1 then newname = toonName break @@ -368,7 +373,12 @@ function Postal_BlackBook:SortAndCountNumFriends() local numBNetTotal, numBNetOnline = BNGetNumFriends() for i= 1, numBNetOnline do local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR = BNGetFriendInfo(i) - if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(toonID)) then + if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then + local accountID = toonID + else + local accountID = C_BattleNet.GetFriendAccountInfo(i) + end + if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(accountID)) then -- Check if already on friends list local alreadyOnList = false for j = 1, numFriends do