[6928] Corrected the handling of evade and threat for creature summoned pets. Should fix some of the setVisibility crashes.

This commit is contained in:
Wyk3d 2008-12-22 01:22:09 +02:00 committed by tomrus88
parent 1884889f04
commit ed4efc317c
3 changed files with 21 additions and 4 deletions

View file

@ -9094,8 +9094,16 @@ bool Unit::CanHaveThreatList() const
if( !isAlive() )
return false;
// pets and totems can not have threat list
if( ((Creature*)this)->isPet() || ((Creature*)this)->isTotem() || ((Creature*)this)->isVehicle() )
// totems can not have threat list
if( ((Creature*)this)->isTotem() )
return false;
// vehicles can not have threat list
if( ((Creature*)this)->isVehicle() )
return false;
// pets can not have a threat list, unless they are controlled by a creature
if( ((Creature*)this)->isPet() && IS_PLAYER_GUID(((Pet*)this)->GetOwnerGUID()) )
return false;
return true;