Dicebar / Raven

Raven add-on for World of Warcraft
9 stars 3 forks source link

Wrath Classic C_AddOns error #55

Closed Road-block closed 9 months ago

Road-block commented 9 months ago

The C_AddOns namespace exists in Wrath Classic but in a rudimentary version.

It only contains the GetAddOnMetadata method as of 3.4.3

Latest update r635 errors due to trying to call C_AddOns.LoadAddOn in a few places. LoadAddOn is still a global in 3.4.3

Road-block commented 9 months ago

An easy fix would be to have something like this up around L:166 where the UnitAura upvalue is defined

local C_AddOns = setmetatable(_G.C_AddOns or {},{__index = _G})
Dicebar commented 9 months ago

Thanks for the report and the fix. It's rolling out now!

Road-block commented 9 months ago

Thanks for the report and the fix. It's rolling out now!

Hmm, I'm not sure that fix is proper.

Road-block commented 9 months ago

By having it in a conditional local C_AddOns would not be available outside of the if then end scope. It might work incidentally because setmetatable sets __index to _G on _G.C_AddOns but even if it does it's not future proof.

Dicebar commented 9 months ago

It does work because of the reasons you described, but it's indeed not future proof. I've rewritten the fix.