mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[8715] Fixed possible crashes and some typos
This commit is contained in:
parent
b1888bb343
commit
f286a2e64e
5 changed files with 17 additions and 17 deletions
|
|
@ -1568,17 +1568,17 @@ void Unit::HandleEmoteCommand(uint32 anim_id)
|
|||
uint32 Unit::CalcNotIgnoreAbsorbDamage( uint32 damage, SpellSchoolMask damageSchoolMask, SpellEntry const* spellInfo /*= NULL*/)
|
||||
{
|
||||
float absorb_affected_rate = 1.0f;
|
||||
Unit::AuraList const& ignoreAbsorb = GetAurasByType(SPELL_AURA_MOD_IGNORE_ABSORB_SCHOOL);
|
||||
for(Unit::AuraList::const_iterator i = ignoreAbsorb.begin(); i != ignoreAbsorb.end(); ++i)
|
||||
Unit::AuraList const& ignoreAbsorbSchool = GetAurasByType(SPELL_AURA_MOD_IGNORE_ABSORB_SCHOOL);
|
||||
for(Unit::AuraList::const_iterator i = ignoreAbsorbSchool.begin(); i != ignoreAbsorbSchool.end(); ++i)
|
||||
if ((*i)->GetMiscValue() & damageSchoolMask)
|
||||
absorb_affected_rate *= (100.0f - (*i)->GetModifier()->m_amount)/100.0f;
|
||||
|
||||
if(spellInfo)
|
||||
{
|
||||
Unit::AuraList const& ignoreAbsorb = GetAurasByType(SPELL_AURA_MOD_IGNORE_ABSORB_FOR_SPELL);
|
||||
for(Unit::AuraList::const_iterator i = ignoreAbsorb.begin(); i != ignoreAbsorb.end(); ++i)
|
||||
if ((*i)->isAffectedOnSpell(spellInfo))
|
||||
absorb_affected_rate *= (100.0f - (*i)->GetModifier()->m_amount)/100.0f;
|
||||
Unit::AuraList const& ignoreAbsorbForSpell = GetAurasByType(SPELL_AURA_MOD_IGNORE_ABSORB_FOR_SPELL);
|
||||
for(Unit::AuraList::const_iterator citr = ignoreAbsorbForSpell.begin(); citr != ignoreAbsorbForSpell.end(); ++citr)
|
||||
if ((*citr)->isAffectedOnSpell(spellInfo))
|
||||
absorb_affected_rate *= (100.0f - (*citr)->GetModifier()->m_amount)/100.0f;
|
||||
}
|
||||
|
||||
return absorb_affected_rate <= 0.0f ? 0 : (absorb_affected_rate < 1.0f ? uint32(damage * absorb_affected_rate) : damage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue