Jump to content

SpellProcEvent Handling


Guest nakx
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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^^

Link to comment
Share on other sites

 Share

×
×
  • 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