Scripts / Naxxramas : add missing null pointer check. Fixes CID 1354738

This commit is contained in:
Aokromes
2016-07-20 19:50:00 +02:00
parent 42eba318de
commit 75ca64a383

View File

@@ -406,18 +406,18 @@ 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.
//me->GetMotionMaster()->MoveFollow(gluth, 0, 0); // the zombies will stand still too far away from Gluth at the end of their movement. Also doesnt seem to work with SetWalk(true)
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.0f)
me->StopMoving();
}
if (me->GetExactDist2d(gluth) <= 10.0)
me->StopMoving();
}
else if (state == STATE_ZOMBIE_NORMAL)
DoMeleeAttackIfReady();