Circumvented Deprecated API Call / Invalid Arg Error#32
Circumvented Deprecated API Call / Invalid Arg Error#32Bitwise1057 wants to merge 3 commits intoLudiusMaximus:masterfrom
Conversation
Added checks for which API is present. Added error catch to return default values if mountID is nil or invalid.
|
Sorry I left you PR unanswered for so long. Maybe @Shushuda can take it from here... :-) |
|
Oops, I think I might have fixed those two errors in these commits today hahaha The proper replacement for the UnitBuff (which was an alias for UnitAura(unit, index, "HELPFUL") ) is C_UnitAuras.GetBuffDataByIndex, hence why I replaced it with that. As for the other one, my debugging seemed to always land in that one spot with force dismount due to lastActiveMount being nil, hence why the fix is just an if-statement wrap. Seems to work for Soar (which I could reproduce), but I haven't encountered this bug on regular dismounting. |
|
I'll have to look into it when I get the chance. I do not currently have the full printout as it has been a few months since I was working with this and changes with the API may have had some manner of impact since then. |
Replaced UnitBuff with C_TooltipInfo.GetUnitBuff, since UnitBuff has been deprecated.
Resolved error:
Message: ...nterface/AddOns/CameraOverShoulderFix/correction.lua:297: attempt to call upvalue 'UnitBuff' (a nil value)Patched an issue with the mount journal API that repeatedly threw:
Message: bad argument #1 to '?' (Usage: local name, spellID, icon, isActive, isUsable, sourceType, isFavorite, isFactionSpecific, faction, shouldHideOnChar, isCollected, mountID, isSteadyFlight = C_MountJourn...)This error prevented the camera from resetting correctly after dismounting.
Added API checks and error handling as a temporary workaround until a proper fix is in place.
These changes should stop the addon from throwing runtime errors in current builds while maintaining functionality.