TrinityCore/TrinityCore — Issue #3750: [GDB-Backtrace] Unit::HasAuraState
Author: Amit86
Created: 2011-10-30 22:41:47+00:00
State: open

GDB Crash log: http://pastebin.com/iqssnE2R

at Unit::HasAuraState (this=0x0, flag=AURA_STATE_HEALTHLESS_35_PERCENT, spellProto=0x2aaabc597c00, Caster=0x2aaaf1e72000) at /home/wow/hg/trinitycore/src/server/game/Entities/Unit/Unit.cpp:9647

Unit.cpp
```

bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit const* Caster) const
{
if (Caster)
{
if (spellProto)
{
AuraEffectList const& stateAuras = Caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for (AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
if ((*j)->IsAffectedOnSpell(spellProto))
return true;
}
// Check per caster aura state
// If aura with aurastate by caster not found return false
if ((1<<(flag-1)) & PER_CASTER_AURA_STATE_MASK)
{
for (AuraStateAurasMap::const_iterator itr = m_auraStateAuras.lower_bound(flag); itr != m_auraStateAuras.upper_bound(flag); ++itr)
if (itr->second->GetBase()->GetCasterGUID() == Caster->GetGUID())
return true;
return false;
}
}

return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
}
```

Hash: f2000f3