Jump to content

SpellProcEvent Handling


Recommended Posts

Posted

Hello,

I was working with some SpellProcEvent and found something i think it may be wrong. The function called IsSpellProcEventCanTriggeredBy was supposed to verify if a SpellProcEvent is going to be triggered by the event that just happened.

The problem is with the code:


           // spellFamilyName is Ok need check for spellFamilyMask if present
           if(spellProcEvent->spellFamilyMask || spellProcEvent->spellFamilyMask2)
           {
               if ((spellProcEvent->spellFamilyMask  & procSpell->SpellFamilyFlags ) == 0 &&
                   (spellProcEvent->spellFamilyMask2 & procSpell->SpellFamilyFlags2) == 0)
                   return false;
               active = true; // Spell added manualy -> so its active spell
           }

At this point it is going to check if the SpellFamilyMask and SpellFamilyMask2 matches with the spell that was casted.I believe, that even if only one mask Fail, the result should return false. But with this code, BOTH of the masks must fail to return false.

So i think that the code should be:

           // spellFamilyName is Ok need check for spellFamilyMask if present
           if(spellProcEvent->spellFamilyMask || spellProcEvent->spellFamilyMask2)
           {
               if ((spellProcEvent->spellFamilyMask  & procSpell->SpellFamilyFlags ) == 0 [b]||[/b]
                   (spellProcEvent->spellFamilyMask2 & procSpell->SpellFamilyFlags2) == 0)
                   return false;
               active = true; // Spell added manualy -> so its active spell
           }

I could have posted on patches, but im not sure if im right.

What do you think?

Posted

Return false if none of the bitmasks fit. Meaning, if any bit of the current triggering spell fits to the bitmask of the aura, the if will be false and you will go to the code after the if (the return true).

So code should be ok like that ;-)

Posted

Exactly, but if only one mask fit, the result wont be false. In other words, only one mask has to fit to return true.

It should be both of them should fit to return true ?

Posted

No that is not correct. There are only multiple family flag fields, because they need more than just 32bit (there are 3 fields, the first two are united in a 64 bit value in the core, while the 3rd one is 32bit).

Just imgine that you have 96 bits and want to find out if any of those bits fits^^

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use