From 97f65d9b4dfb850961875bc4b4520a8e26171d3e Mon Sep 17 00:00:00 2001 From: ForesterDev Date: Tue, 19 Jul 2016 12:41:42 +0400 Subject: Scripts / Naxxramas : add missing null pointer check. Fixes CID 1354738 (#17628) (cherry picked from commit d57c177d0ba8399925cc86d5f8904df2aa5635b4) # Conflicts: # src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp --- src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index ed7e4689059..ce24d36b007 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -405,17 +405,17 @@ public: if (state == STATE_ZOMBIE_DECIMATED) { timer += diff; - // 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 (Creature* gluth = ObjectAccessor::GetCreature(*me, GluthGUID)) { - if (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. + // 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) + if (me->GetExactDist2d(gluth) <= 10.0f) me->StopMoving(); } } -- cgit v1.2.3