doadin / Baggins

zlib License
6 stars 7 forks source link

Issues in Cataclysm classic prepatch, error in dependent library LibBagUtils-1.0 #107

Closed glajchs closed 5 months ago

glajchs commented 5 months ago

Full error below at the bottom, but I was able to get this working by manually patching the Lib LibBagUtils-1.0 to support cata classic. It has some if statements for wrath/bc/etc classic, but not cata. I added the following function at around line 70 (next to IsWrathWow()):

local function IsCataWow() --luacheck: ignore 212
    return WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC and LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_CATACLYSM
end

And then in the 3 different places in the file that there is an or chain of "is wrath/bc, etc" I added the IsCataWow() to the or as well. This fixed it right up and baggins loaded without errors! if IsClassicWow() or IsTBCWow() or IsWrathWow() or IsCataWow() then

Error output:

Time: Wed May  1 01:25:51 2024
Count: 1
Stack: ...Ons/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:296: attempt to index field 'BAGS' (a nil value)
[string "@Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua"]:296: in main chunk

Locals: MAJOR = "LibBagUtils-1.0"
MINOR = 50
LibStub = <table> {
 NewLibrary = <function> defined @Interface/AddOns/LibStub/LibStub.lua:20
 minors = <table> {
 }
 minor = 2
 IterateLibraries = <function> defined @Interface/AddOns/LibStub/LibStub.lua:46
 GetLibrary = <function> defined @Interface/AddOns/LibStub/LibStub.lua:36
 libs = <table> {
 }
}
lib = <table> {
 GetContainerNumFreeSlots = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:234
 GetContainerFamily = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:214
 MakeLinkComparator = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:260
 slotLocks = <table> {
 }
}
strmatch = <function> defined =[C]:-1
gsub = <function> defined =[C]:-1
band = <function> defined =[C]:-1
pairs = <function> defined =[C]:-1
select = <function> defined =[C]:-1
type = <function> defined =[C]:-1
next = <function> defined =[C]:-1
tonumber = <function> defined =[C]:-1
tostring = <function> defined =[C]:-1
GetTime = <function> defined =[C]:-1
WOW_PROJECT_ID = 14
WOW_PROJECT_CLASSIC = 2
WOW_PROJECT_BURNING_CRUSADE_CLASSIC = 5
WOW_PROJECT_MAINLINE = 1
LE_EXPANSION_LEVEL_CURRENT = 3
LE_EXPANSION_BURNING_CRUSADE = 1
LE_EXPANSION_WRATH_OF_THE_LICH_KING = 2
GetContainerNumSlots = <function> defined =[C]:-1
GetContainerNumFreeSlots = <function> defined =[C]:-1
GetContainerItemLink = <function> defined =[C]:-1
GetContainerItemInfo = <function> defined =[C]:-1
GetItemInfo = <function> defined =[C]:-1
GetItemFamily = <function> defined =[C]:-1
NUM_BANKBAGSLOTS = 7
NUM_BAG_SLOTS = 4
PickupContainerItem = nil
CursorHasItem = <function> defined =[C]:-1
GetCursorInfo = <function> defined =[C]:-1
ClearCursor = <function> defined =[C]:-1
geterrorhandler = <function> defined =[C]:-1
BANK_CONTAINER = -1
IsClassicWow = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:57
IsTBCWow = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:61
IsWrathWow = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:65
IsRetailWow = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:69
BACKPACK_CONTAINER = 0
KEYRING_CONTAINER = nil
REAGENTBANK_CONTAINER = nil
IsReagentBankUnlocked = nil
escapePatterns = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:116
floor = <function> defined =[C]:-1
compareFuzzySuffix = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:127
makeLinkComparator = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:135
lockSlot = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:183
isLocked = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:191
GetContainerFamily = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:204
myGetContainerNumFreeSlots = <function> defined @Interface/AddOns/Baggins/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua:219
bags = <table> {
}
(for index) = 1
(for limit) = 4
(for step) = 1
i = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field 'BAGS' (a nil value)"
doadin commented 5 months ago

Thanks I will look into making these changes soon.

doadin commented 5 months ago

Thanks, these changes should be included in the next release, I just pushed out.