Core: Fix many "errors"/warnings and coding style (2)

Scripts; also reverted a change to AuthSocket

Errors were found using Cppcheck, open-source static analysis tool
This commit is contained in:
Nay
2012-08-30 22:44:03 +01:00
parent 5f1977cb1d
commit abbb896cfb
16 changed files with 70 additions and 93 deletions
+22 -18
View File
@@ -1911,16 +1911,18 @@ class spell_gen_break_shield: public SpellScriptLoader
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
Aura* aura = itr->second->GetBase();
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
if (Aura* aura = itr->second->GetBase())
{
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
// Remove dummys from rider (Necessary for updating visual shields)
if (Unit* rider = target->GetCharmer())
if (Aura* defend = rider->GetAura(aura->GetId()))
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
break;
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
{
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
// Remove dummys from rider (Necessary for updating visual shields)
if (Unit* rider = target->GetCharmer())
if (Aura* defend = rider->GetAura(aura->GetId()))
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
break;
}
}
}
break;
@@ -2039,16 +2041,18 @@ class spell_gen_mounted_charge: public SpellScriptLoader
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
Aura* aura = itr->second->GetBase();
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
if (Aura* aura = itr->second->GetBase())
{
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
// Remove dummys from rider (Necessary for updating visual shields)
if (Unit* rider = target->GetCharmer())
if (Aura* defend = rider->GetAura(aura->GetId()))
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
break;
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
{
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
// Remove dummys from rider (Necessary for updating visual shields)
if (Unit* rider = target->GetCharmer())
if (Aura* defend = rider->GetAura(aura->GetId()))
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
break;
}
}
}
break;