diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp index 8a7ed49e8..42a44b984 100644 --- a/src/game/BattleGroundAB.cpp +++ b/src/game/BattleGroundAB.cpp @@ -457,7 +457,7 @@ void BattleGroundAB::Reset() //call parent's class reset BattleGround::Reset(); - for (uint8 i = 0; i <= BG_TEAMS_COUNT; ++i) + for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) { m_TeamScores[i] = 0; m_lastTick[i] = 0; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 91922cafe..2c38fd922 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1817,19 +1817,21 @@ void Spell::EffectDummy(uint32 i) // Cleansing Totem if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->SpellIconID==1673) { - m_caster->CastSpell(unitTarget, 52025, true); + if (unitTarget) + m_caster->CastSpell(unitTarget, 52025, true); return; } // Healing Stream Totem if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000)) { - m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); + if (unitTarget) + m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); return; } // Mana Spring Totem if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) { - if (unitTarget->getPowerType()!=POWER_MANA) + if (!unitTarget || unitTarget->getPowerType()!=POWER_MANA) return; m_caster->CastCustomSpell(unitTarget, 52032, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); return; diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index f2971702a..75e07ff40 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -100,21 +100,19 @@ uint16 GetSpellAuraMaxTicks(SpellEntry const* spellInfo) if(DotDuration > 30000) DotDuration = 30000; - int j = 0; - for( ; j < 3; j++) + for (int j = 0; j < 3; ++j) { - if( spellInfo->Effect[j] == SPELL_EFFECT_APPLY_AURA && ( + if (spellInfo->Effect[j] == SPELL_EFFECT_APPLY_AURA && ( spellInfo->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_DAMAGE || spellInfo->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_HEAL || spellInfo->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) ) { + if (spellInfo->EffectAmplitude[j] != 0) + return DotDuration / spellInfo->EffectAmplitude[j]; break; } } - if(spellInfo->EffectAmplitude[j] != 0) - return DotDuration / spellInfo->EffectAmplitude[j]; - return 6; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8f659f615..77dfe50cf 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 77cf726ce..f63acfeae 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8714" + #define REVISION_NR "8715" #endif // __REVISION_NR_H__