ProjectSkyfire / SkyFire.406a

SkyFireEMU is a full featured F/OSS World of Warcraft: Cataclysm emulator written in C++. || Compatible with World of Warcraft client 4.0.6a (Build:13623) || Public DB is located on forum
http://www.projectskyfire.org
GNU General Public License v3.0
344 stars 218 forks source link

Random crash in CanCastWhileWalking #619

Open roc13x opened 12 years ago

roc13x commented 12 years ago

Full debug crashlog here: http://pastebin.com/qLt6ATee

Cannot reliably reproduce, seems to happen only sometimes

Walkum commented 12 years ago

Confirm this. I cannot reproduce too.

Walkum commented 12 years ago

PD: roc13x see this please: https://github.com/ProjectSkyfire/SkyFireEMU/commit/2d29e7b8eaa42c1997cfc3597b712fe9cde86e29

The players cannot play battlegrounds by these crash.

pbabics commented 12 years ago
    for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
    {
        if ((*itr)->GetSpellInfo()->Effects[(*itr)->GetEffIndex()].SpellClassMask.HasFlag(spell->GetSpellClassOptions()->SpellFamilyFlags))
            return true;
    }

Spell does not actualy need to have SpellClassOptions entry so _spell->GetSpellClassOptions()->SpellFamilyFlags_ can cause crash by pointing somewhere (over the rainbow). Instead of _spell->GetSpellClassOptions()->SpellFamilyFlags_ you should use _spell->SpellFamilyFlags_ that is initialized when SpellInfo is constructed.

so replace this:

    for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
    {
        if ((*itr)->GetSpellInfo()->Effects[(*itr)->GetEffIndex()].SpellClassMask.HasFlag(spell->GetSpellClassOptions()->SpellFamilyFlags))
            return true;
    }

by:

    for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
    {
        if ((*itr)->GetSpellInfo()->Effects[(*itr)->GetEffIndex()].SpellClassMask.HasFlag(spell->SpellFamilyFlags))
            return true;
    }
Walkum commented 12 years ago

Thanks @NTX ^^ , I will try it.

roc13x commented 12 years ago

Will give it a try and see how it runs, thanks!

@Walkum I'm not sure what causes those crashes, sorry. I'm not too well up on the minion system. That commit was just a hotfix for a frequent crash.