Skip to content

Circumvented Deprecated API Call / Invalid Arg Error#32

Open
Bitwise1057 wants to merge 3 commits intoLudiusMaximus:masterfrom
Bitwise1057:master
Open

Circumvented Deprecated API Call / Invalid Arg Error#32
Bitwise1057 wants to merge 3 commits intoLudiusMaximus:masterfrom
Bitwise1057:master

Conversation

@Bitwise1057
Copy link

@Bitwise1057 Bitwise1057 commented Sep 2, 2025

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.

Added checks for which API is present.
Added error catch to return default values if mountID is nil or invalid.
@Bitwise1057 Bitwise1057 changed the title Updated Deprecated API Call Circumvented Deprecated API Call / Invalid Arg Error Sep 2, 2025
@LudiusMaximus
Copy link
Owner

Sorry I left you PR unanswered for so long. Maybe @Shushuda can take it from here... :-)

@Shushuda
Copy link
Collaborator

Oops, I think I might have fixed those two errors in these commits today hahaha

b657a15
12aa842

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.
Was Message: bad argument #1 to '?' happening on regular mounts too? Do you have the full error printout from BugSack, including Locals at the bottom? That would be very helpful.

@Bitwise1057
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants