[7128] Cleanup in PetHandler.cpp and little PetAI.cpp

Fixed: pet stop attacking when casts spell by command.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-01-21 01:29:08 +01:00
parent 9e1b9e56fd
commit 03b7d1006a
3 changed files with 41 additions and 38 deletions

View file

@ -139,11 +139,11 @@ void PetAI::UpdateAI(const uint32 diff)
else
m_updateAlliesTimer -= diff;
if (inCombat && i_pet.getVictim() == NULL)
if (inCombat && !i_pet.getVictim())
_stopAttack();
// i_pet.getVictim() can't be used for check in case stop fighting, i_pet.getVictim() clear at Unit death etc.
if( i_pet.getVictim() != NULL )
if( i_pet.getVictim() )
{
if( _needToStop() )
{