Quantcast

Fix ticket #196 - DebuffPresent(Magic) wrong with Pally buffs

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2013-03-19 23:31:41
Author local date 2013-03-19 23:31:41 +0000
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2013-03-19 23:31:41
Committer local date 2013-03-19 23:31:41 +0000
Commit e199f128987cd0cc21120301f111658e0e6ad930
Tree b6cf23525460c7b7920bf600679acc16c954643f
Parent 43b7f3a6c608e49cd2ba35c5f04f19b92d9c49d3
Fix ticket #196 - DebuffPresent(Magic) wrong with Pally buffs

The problem was caused by the Buff*() and Debuff*() conditions being
aliases for each other that actually just checked every aura on a target,
regardless of whether it was a buff or a debuff, e.g., the following two
conditions returned the same result:

    DebuffPresent(Magic)
    BuffPresent(Magic)

This made it impossible to do something like the following if the player
had any dispellable raid buffs:

    if DebuffPresent(Magic) Spell(cleanse)

Fix this by splitting out the buffs and debuffs per unit into separate
lists in OvaleAura and OvaleState, and teaching all of the methods that
manipulate or reference the aura tables to take an additional ``filter''
argument that can be ``HELPFUL'' (buff), ``HARMFUL'' (debuff) or nil
(either).

Introduce a new condition parameter ``filter''.  The ``filter'' parameter
is used to narrow down the auras that Ovale inspects to check a condition.
If specified, its valid values are ``buff'', ``debuff'' or ``any'',
defaulting to ``any''.

The Buff*() and Debuff*() conditions implicitly set the filter to ``buff''
or ``debuff'', respectively.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@802 d5049fe3-3747-40f7-a4b5-f36d6801af5f