aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-01-18 21:53:04 +0100
committerjackpoz <giacomopoz@gmail.com>2015-01-18 21:53:04 +0100
commit1a4b1beb141182bd050ed8fa1220597e8ed837a8 (patch)
treea7f4447df66116c9f5537cf487be2344084ec414 /src/server/scripts
parent5dfd07fa4f1383105e1bdb8ece173a660c7dd3d2 (diff)
Core/Misc: Fix static analysis issues
Fix some static analysis issues reported by Coverity
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp14
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp29
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp7
3 files changed, 34 insertions, 16 deletions
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index 3f44de57968..88b694f742c 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -107,7 +107,16 @@ class boss_mandokir : public CreatureScript
struct boss_mandokirAI : public BossAI
{
- boss_mandokirAI(Creature* creature) : BossAI(creature, DATA_MANDOKIR) { }
+ boss_mandokirAI(Creature* creature) : BossAI(creature, DATA_MANDOKIR)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ _ohganotSoFast = true;
+ _reanimateOhganCooldown = false;
+ }
void Reset() override
{
@@ -116,8 +125,7 @@ class boss_mandokir : public CreatureScript
_Reset();
me->SummonCreatureGroup(SUMMON_GROUP_CHAINED_SPIRIT);
- _ohganotSoFast = true;
- _reanimateOhganCooldown = false;
+ Initialize();
_reviveGUID.Clear();
}
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp
index 3da33de01f7..ecf44db800a 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp
@@ -133,22 +133,25 @@ public:
DoCastAOE(SPELL_ACTIVATE_BEACONS);
- std::list<Creature*> stalkers;
GameObject* door = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_ANHUUR_DOOR));
- GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f);
-
- stalkers.remove_if(Trinity::HeightDifferenceCheck(door, 0.0f, false)); // Target only the bottom ones
- for (std::list<Creature*>::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr)
+ if (door)
{
- if ((*itr)->GetPositionX() > door->GetPositionX())
- {
- (*itr)->CastSpell((*itr), SPELL_SHIELD_VISUAL_LEFT, true);
- (*itr)->CastSpell((*itr), SPELL_BEAM_OF_LIGHT_LEFT, true);
- }
- else
+ std::list<Creature*> stalkers;
+ GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f);
+
+ stalkers.remove_if(Trinity::HeightDifferenceCheck(door, 0.0f, false)); // Target only the bottom ones
+ for (std::list<Creature*>::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr)
{
- (*itr)->CastSpell((*itr), SPELL_SHIELD_VISUAL_RIGHT, true);
- (*itr)->CastSpell((*itr), SPELL_BEAM_OF_LIGHT_RIGHT, true);
+ if ((*itr)->GetPositionX() > door->GetPositionX())
+ {
+ (*itr)->CastSpell((*itr), SPELL_SHIELD_VISUAL_LEFT, true);
+ (*itr)->CastSpell((*itr), SPELL_BEAM_OF_LIGHT_LEFT, true);
+ }
+ else
+ {
+ (*itr)->CastSpell((*itr), SPELL_SHIELD_VISUAL_RIGHT, true);
+ (*itr)->CastSpell((*itr), SPELL_BEAM_OF_LIGHT_RIGHT, true);
+ }
}
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index f696fffb2ea..b3caff679df 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -853,6 +853,13 @@ class spell_warr_vigilance : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_vigilance_AuraScript);
+ public:
+ spell_warr_vigilance_AuraScript()
+ {
+ _procTarget = nullptr;
+ }
+
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_VENGEANCE))