Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Calling protected function in combat fails. #24

Open
drveoj opened this issue Sep 16, 2016 · 5 comments
Open

[Bug] Calling protected function in combat fails. #24

drveoj opened this issue Sep 16, 2016 · 5 comments

Comments

@drveoj
Copy link

drveoj commented Sep 16, 2016

Buggrabber catches this if one is unfortunate enough to get caught in combat mid-quest chat.

1x [ADDON_ACTION_BLOCKED] AddOn 'CatchTheWind' tried to call the protected function 'MinimapCluster:Show()'.
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Show'
CatchTheWind\CatchTheWind-1.5.lua:243: in function <CatchTheWind\CatchTheWind.lua:237>
CatchTheWind\CatchTheWind-1.5.lua:824: in function <CatchTheWind\CatchTheWind.lua:823>
CatchTheWind\CatchTheWind-1.5.lua:68: in function <CatchTheWind\CatchTheWind.lua:64>

Locals:

@Lanrutcon
Copy link
Owner

Hello there.

I tried to perform this but I never got any warning. I also download !Bugrabber and the results were the same.

Tried "manually" with _/run MinimapCluster:Show()_ while in-combat and, again, no error.

So, dunno if there is an addon that is causing this problem, but could you try changing that line to "_Minimap:Show()_" and see if the problem still persists.

Thank you for reporting.

@drveoj
Copy link
Author

drveoj commented Sep 19, 2016

Change line 285 in CatchTheWind.lua to something like:

if (not InCombatLockdown() and MinimapCluster:IsShown()) MinimapCluster:Hide(); end --Minimap icons aren't affected by "SetAlpha"

MinimapCluster:Hide() is protected and can't be called in combat...

@chevcast
Copy link

Ah yes, I have seen the restricted function error while in combat.

@drveoj
Copy link
Author

drveoj commented Sep 19, 2016

Woops. I missed out a "then" :)

if (not InCombatLockdown() and MinimapCluster:IsShown()) then MinimapCluster:Hide(); end

@Lanrutcon
Copy link
Owner

After doing more tests, I found out that if ElvUI is enabled and its custom minimap is enabled as well, then you can't call ":Show()" or ":Hide()" while in combat. Dunno if other addons are doing similar things.

I will implement a simple workaround for special cases like this. If you find another addon, besides ElvUI, report back.

I can't really add a condition to check if the player is in-combat or not. If there was combat, the minimap icons wouldn't disappear, making a little bit wonky.

If you are feeling "brave", you can add this line: MMHolder:SetParent(ElvUIParent); inside onPlayerLogin function (line 601).

Thanks once again.

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

No branches or pull requests

3 participants