aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorForesterDev <forester.manv@gmail.com>2016-07-19 12:41:42 +0400
committerShauren <shauren.trinity@gmail.com>2016-07-19 10:41:42 +0200
commitd57c177d0ba8399925cc86d5f8904df2aa5635b4 (patch)
tree7282f8d184b43c4f908d22daa316b53345b1ff2a /src
parent3a77dec6e6fac47fedeb0aeddd09dfe12c3817a2 (diff)
Scripts / Naxxramas : add missing null pointer check. Fixes CID 1354738 (#17628)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index ef6ccf5bf4b..6ec9af68723 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -405,17 +405,19 @@ public:
if (state == STATE_ZOMBIE_DECIMATED)
{
timer += diff;
- Creature* gluth = ObjectAccessor::GetCreature(*me, GluthGUID);
- // Putting this in the UpdateAI loop fixes an issue where death gripping a decimated zombie would make the zombie stand still until the rest of the fight.
- // Also fix the issue where if one or more zombie is rooted when decimates hits (and MovePoint() is called), the zombie teleport to the boss. pretty weird behavior.
- if (gluth && timer>1600 && me->GetExactDist2d(gluth) > 10.0 && me->CanFreeMove()) // it takes about 1600 ms for the animation to cycle. This way, the animation looks relatively smooth.
+ if (Creature* gluth = ObjectAccessor::GetCreature(*me, GluthGUID))
{
- me->GetMotionMaster()->MovePoint(0, gluth->GetPosition()); // isn't dynamic. So, to take into account Gluth's movement, it must be called periodicly.
- timer = 0;
- }
+ // Putting this in the UpdateAI loop fixes an issue where death gripping a decimated zombie would make the zombie stand still until the rest of the fight.
+ // Also fix the issue where if one or more zombie is rooted when decimates hits (and MovePoint() is called), the zombie teleport to the boss. pretty weird behavior.
+ if (timer > 1600 && me->GetExactDist2d(gluth) > 10.0f && me->CanFreeMove()) // it takes about 1600 ms for the animation to cycle. This way, the animation looks relatively smooth.
+ {
+ me->GetMotionMaster()->MovePoint(0, gluth->GetPosition()); // isn't dynamic. So, to take into account Gluth's movement, it must be called periodicly.
+ timer = 0;
+ }
- if (me->GetExactDist2d(gluth) <= 10.0)
- me->StopMoving();
+ if (me->GetExactDist2d(gluth) <= 10.0f)
+ me->StopMoving();
+ }
}
else if (state == STATE_ZOMBIE_NORMAL)
DoMeleeAttackIfReady();