aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authorDuarte Duarte <dnpd.dd@gmail.com>2017-11-14 11:23:25 +0000
committerGitHub <noreply@github.com>2017-11-14 11:23:25 +0000
commitae917e950bbf5e31cbf3c6c537bd34ba4ef883ad (patch)
treebe0645db0fabc9093d929a1bb3643c6224c496e8 /src/server/scripts/Northrend
parentebf085a9bf104806ad6536b6902aa0781cbb7e5c (diff)
Scripts: Fix static analysis issues CID 1381648, 1379869, 1377302 and… (#20748)
* Scripts: Fix static analysis issues CID 1381648, 1379869, 1377302 and 1377300
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp5
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index fc90699307b..09a7fdc1d4f 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
@@ -589,8 +589,9 @@ class spell_marrowgar_coldflame_damage : public SpellScriptLoader
if (target->HasAura(SPELL_IMPALED))
return false;
- if (target->GetExactDist2d(GetOwner()) > GetSpellInfo()->GetEffect(target->GetMap()->GetDifficultyID(), EFFECT_0)->CalcRadius())
- return false;
+ if (SpellEffectInfo const* effect = GetSpellInfo()->GetEffect(target->GetMap()->GetDifficultyID(), EFFECT_0))
+ if (target->GetExactDist2d(GetOwner()) > effect->CalcRadius())
+ return false;
if (Aura* aur = target->GetAura(GetId()))
if (aur->GetOwner() != GetOwner())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index 6d29fe8a46d..f9af80eaca1 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -1549,7 +1549,8 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader
PreventDefaultAction();
if (Unit* caster = GetCaster())
{
- caster->AddThreat(GetTarget(), -float(GetSpellInfo()->GetEffect(caster->GetMap()->GetDifficultyID(), EFFECT_1)->CalcValue()));
+ if (SpellEffectInfo const* effect = GetSpellInfo()->GetEffect(caster->GetMap()->GetDifficultyID(), EFFECT_1))
+ caster->AddThreat(GetTarget(), -float(effect->CalcValue()));
caster->GetAI()->SetData(DATA_WHELP_MARKER, 0);
}
}