Skip to content

Commit

Permalink
superwow: ignore buff procs during cast
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Aug 10, 2024
1 parent ada9ee9 commit 641476c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/superwow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ pfUI:RegisterModule("superwow", "vanilla", function ()
spell = spell or UNKNOWN
icon = icon or "Interface\\Icons\\INV_Misc_QuestionMark"

-- skip on buff procs during cast
if event_type == "CAST" then
if not libcast.db[guid] or libcast.db[guid].cast ~= spell then
-- ignore casts without 'START' event, while there is already another cast.
-- those events can be for example a frost shield proc while casting frostbolt.
-- we want to keep the cast itself, so we simply skip those.
return
end
end

-- add cast action to the database
if not libcast.db[guid] then libcast.db[guid] = {} end
libcast.db[guid].cast = spell
Expand Down

2 comments on commit 641476c

@ranchao1996
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I can't understand the content of this update

@shagu
Copy link
Owner Author

@shagu shagu commented on 641476c Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I can't understand the content of this update

No problem, I'll try to explain in more detail:
Each real spell starts the cast with a 'START' event. The 'CAST' event is used to update flags of a cast but also fires on procs. Let's imagine a Defias Mage who is casting Fireball while having a Frostshield on:

  1. 'START' event of Fireball
  2. 'CAST' event of Fireball
  3. You hit him and trigger his Frostshield.
  4. 'CAST' event of Frostshield triggers, which overwrites the current cast (Fireball) of the Defias Mage.
  5. The Fireball is visually gone, as the Frostshield trigger did not had a casting time.

This update ignores all overlapping 'CAST' events, that didn't had a previous 'START' event.
So that real castbars like Fireball won't dissappear, when a spell like Frostshield procs.

Please sign in to comment.