oUF

97.2k Downloads

Possible issue with unit handling on arena frames in PvP Brawls

Blazeflack opened this issue ยท 20 comments

commented

Someone on our team noticed a possible issue with unit handling on arena frames in PvP Brawls. The arena frames are used to show flag carriers, one from each faction. He noticed that clicking an arena frame didn't always target the unit that was being displayed on the frame.

Someone else was able to confirm that it seems to work correctly with the default Blizzard frames. It only shows 2 flag carriers (even though there can be 6 in the brawl). It shows whoever picked up a flag first, and then switches to someone else if/when the first flag carrier drops the flag.

The usual disclaimer applies here, as I can't guarantee that the issue is with oUF and not just ElvUI due to us not using the :Spawn functionality in oUF.

If any of the people who watches this project does PvP on occasion then I would appreciate your insights.

Thank you.

commented

hi, im simpy. sorry this post is just a copy/paste of conversation but it may hold some useful (idk) information.
for reference: https://git.tukui.org/elvui/elvui/commit/1a33d01c this is a temp fix for ElvUI to just disable the frames inside of this brawl, that i did last night. not directly related to any oUF code.

Resike - Today at 5:55 AM
i've run a brawl yesterday and the default blizz frames seemed to work for me properly
there is 2 fc frames, whoever picks the flag up first, then jumps to the second fc when someone dies
Simpy - Today at 9:35 AM
o hmm
@Resike on blizz ui (0 addons) i had no arena frames for flag carrier
so wut
ill check out that copychat thing tho blaze
Resike - Today at 9:42 AM
yeah i had that just now too
but i had no issues with targeting
Simpy - Today at 9:42 AM
mine would target but it would have the wrong color/class/name
target/health matched
but the info on it was wrong for me
Resike - Today at 9:42 AM
thats an usual arena bug
Simpy - Today at 9:43 AM
sigh
i never had problems with these in reg bgs but this one is goofed for me >x>
Resike - Today at 9:44 AM
it has something to do with if your party is not full then the unit id's are fucked up
Simpy - Today at 9:47 AM
hmmm
tbh im not sure
all i know is
i was chain running that brawl
every game they were broken
and i got tired of seeing my name and the health go down lol thinking im dying or something when i was fine XD
Resike - Today at 9:51 AM
isnt ouf unregisters them?
Simpy - Today at 9:52 AM
thats handled by us and what i "fixed"
we enable the frames always
if we have them on
i made some code in recent commit to force idsable them in that bg
:shrug: thats all i know
Resike - Today at 9:56 AM
you can test this if you join into an arena that has a member missing then there is a big chance the classes will get mixed up
Simpy - Today at 9:56 AM
i'll just tell this chat to the oUF ticket? :thinking: or if it not oUF problem but blizzard problem?
Resike - Today at 9:57 AM
i'm not sure where is the problem yet
Simpy - Today at 9:57 AM
ok
Resike - Today at 10:26 AM
I'm trying to reproduce it but i can't since it needs a person not to join
commented

also i should note: [in elvui of course] that in brawl hot mogu with 4 orbs and 4 arena frames never had an issue with arena frames here. never really had arena frame issues outside of this brawl warsong scramble ๐Ÿค” not sure if that relates but worth noting if we create a ticket about this over here as well

commented

i just rechecked and with 0 addons, i do not see arena frames in the warsong scramble bg.
with elvui (before the commit posted above): only 2 frames would show up (regardless, even though 6 possible people can have the flag; which is how the normal warsong is but since there are only 5 frames im not sure how we could correctly handle this) and sometimes have the wrong information. by that i mean the units health and who the frame targeted seemed to be linked but the name/class color was of someone else (sometimes). im not sure where that relates to but since there are 6 flags possible and blizz ui doesn't show it, so i made code to just force them disabled in the BG brawl (for now?) though i would rather see if it can be fixed some other way

commented

also just to note: zPerl-2 doesn't appear to have issues with the 2 arena frames being shown here but not very many tests were done. zPerl-2 is still experimental (and doesn't use oUF) but i'm trying to give as much information as i can to this ticket. even if this is unrelated might be useful to know

commented

Resike - Today at 8:03 PM
i know whats the issue
the ouf frames are staticly created simple unit frames
which means their unit attribute never changes
so if the game points a new unit for the attribute it won't get updated and will show the last person in the frame
thats why when you see a mage on the frame and click it it might be a demonhunter or something
what you could do as a dirty hack is to update the frames on "UPDATE_WORLD_STATES" or the alliance/horde chat msg events

commented

It's what I expected, the unit watch system reports the frame but has no valid data for it. We could probably fix this by forcing the [arena] condition or something, but in reality it should not be triggered to show in the first place, so I'm calling this a Blizzard bug.

commented

You could try adding this to units.lua:

elseif(unit:match('arena%d?$')) then
		object:RegisterEvent('ARENA_OPPONENT_UPDATE', object.UpdateAllElements)

or use 'UPDATE_WORLD_STATES' as Resike suggested (pass a true as a third argument to RegisterEvent in that case) if 'ARENA_OPPONENT_UPDATE' does not fire on flag carrier change

commented

Just to clarify, the default UI does not use the arena frames for the flag carriers in the brawl?

commented

If you use secure headers for your arena frames and force an update OnAttributeChanged then this issue does not exists.

commented

@Rainrider i will test this method very soon and get back to you :)

edit: im reverting my changes to ElvUI locally and importing what you suggested; i'll see what happens doing this :D

commented

@Resike
Have you tried what I proposed in my previous comment? Arena frames, like every other frame do react on OnAttributeChanged. The problem is in events.lua - it won't trigger the full update since the unit is still arena%d. This is the same for target and focus and because of it we listen for 'PLAYER_TARGET/FOCUS_CHANGED' to force an update.

commented

@Resike i confirm already that it does fire that event (least, this brawl.)

commented

@Rainrider
I don't think the battleground has ARENA_OPPONENT_UPDATE events. Of couse a regular secure frame can has it's own OnAttributeChanged script, however it does not ever get triggered since it's a static unit frame.

And there is no way that you can listen that, when does the game points the same unit index to a different player, unless your frame is dynamic aka, it's a header.

If you want to stay on a static frame, i could save the UnitGUID, and update the frame on every "UPDATE_WORLD_STATES" if the current and the saved UnitGUID does not match:

function SexyTabe:UPDATE_WORLD_STATES()
	if UnitGUID("arenaX") ~= self.UnitGUID then
		self:UpdateFrame()

		self.UnitGUID = UnitGUID("arenaX")
	end
end
commented

@kodewdle The question is that then if the event is triggering at the right time, also isn't oUF already updating it's arena frames at this event trigger?

commented

@Resike about to find out ๐Ÿ—ก

@Rainrider it appears to keep the two frames updated correctly :)

commented
commented

LUL I tought you already had that event, that was like the first event i added in my frames:

https://github.com/Resike/Z-Perl2/blob/master/ZPerl2/Modules/Arena.lua#L2747

That's why i thought the issue would be the static/dynamic frames since that's the difference between oUF and my frames.

commented

lul ๐Ÿ‹ thank you guys so much for helping with this. ๐Ÿ’ฏ

commented

awesome! thank you rainrider ๐Ÿค—

commented

I'll issue a PR right away, will have to wait for approval though.