From 982296518c7886068691010be9d6b094668e1c31 Mon Sep 17 00:00:00 2001 From: n0n4m3 Date: Sat, 6 Feb 2010 19:06:55 +0300 Subject: [PATCH] Fixed crash in PetAI::UpdateAI. --HG-- branch : trunk --- src/game/PetAI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index d70b0c1be1..dda4a64abe 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -208,11 +208,11 @@ void PetAI::UpdateAI(const uint32 diff) if( !m_creature->HasInArc(M_PI, target) ) { m_creature->SetInFront(target); - if( target->GetTypeId() == TYPEID_PLAYER ) - m_creature->SendUpdateToPlayer( (Player*)target ); + if(target && target->GetTypeId() == TYPEID_PLAYER) + m_creature->SendUpdateToPlayer((Player*)target); if(owner && owner->GetTypeId() == TYPEID_PLAYER) - m_creature->SendUpdateToPlayer( (Player*)owner ); + m_creature->SendUpdateToPlayer((Player*)owner); } m_creature->AddCreatureSpellCooldown(spell->m_spellInfo->Id);