Fix spell cast detection
vendethiel opened this issue · 12 comments
Scenario:
I am casting a Greater Heal
I cast binding Greater Heal before the GCD is over
The client receives a UI_ERROR_MESSAGE (54)
then the client receives a UNIT_SPELLCAST_FAILED
both the alerts and the castbar modules think that the spell currently casted failed, and stop showing the current alert/cast.
[12:04 AM] Resike: blizz changed some stuff tho
[12:05 AM] Resike: instead of incrementing a single number as lineID now every cast has it's own unique guid
[12:06 AM] Resike: channels are not 0 now but 0-000-000-000-000 etc(edited)
[12:11 AM] Resike: but i havn't checked the events in arenas they could be working different with different bugs
[12:12 AM] Resike: i reported mutiple cast relates issues to blizz but i would be surprised if they fixed them
[12:18 AM] Resike: Here this is a cast event, still returns channel GUID, broken as before, just instead of 0, its a GUID filled with zeros: https://i.imgur.com/kt2GcVR.png
[12:19 AM] Resike: And Hearthstone is surely not a channel cast
This isn't really fixed. At the beginning of the arena, it shows all druids casting a regrowth.
Sometimes an alert won't stop showing after a cast was stopped (I think it happens when a cast stops because of a CC landed?).
@slaren the alerts module uses "cast_" .. spell
. But it seems to me like one unit can only be casting a single spell at a time, right..?
I am not sure if I understand the question. To solve the problem, I guess you could try making the IDs of casting alerts based on the lineID rather than on the name of the spells. For example, something like "cast" .. lineID
. The "cast" is there to differentiate it from other types of alerts.
I just mean -- keeping only "cast"
here. so that if I receive a UNIT_SPELLCAST_SUCCEEDED, I cancel all alerts
Isn't that the opposite of the problem that you are trying to solve ? That alerts get cancelled when a UNIT_SPELLCAST_FAILED is received, even if it refers to a different cast ?
no, I solved that problem with line ids. Now I'm stuck with another problem...
Some casts never get a _FAILED or _SUCCEEDED, for some NPCs, vehicles or phased casts...
I just wonder why the cast name is included, but I guess I can remove it. I'll keep the spellID for _FAILED
In that case, I don't know the details of what events are generated in what cases so I can't really help you with that, sorry.
that means:
receive a _START:
store line id
add alert "cast" if spell is "wanted"
receive a _SUCCEEDED:
disrecard spellID
clear alert "cast"
receive a _FAILED:
check line id