[svn] * Disabled the move and stay commands while pet is possessed

* Make pet come back to its owner after possession ends if it's not currently in combat
* Allow the possessed unit to properly change attack targets
* Also remove charm effects from charmed target on owner aura cancel

--HG--
branch : trunk
This commit is contained in:
gvcoman
2008-11-08 23:32:15 -06:00
parent 35a284df7e
commit c014d6667c
4 changed files with 21 additions and 4 deletions
+8
View File
@@ -18764,8 +18764,16 @@ void Player::RemovePossess(bool attack)
else
{
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
// Reinitialize the pet bar and make the pet come back to the owner
if(((Creature*)target)->isPet())
{
PetSpellInitialize();
if (!target->getVictim())
{
target->GetMotionMaster()->MoveFollow(this, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
}
}
else if (target->isAlive())
{
// If we're still hostile to our target, continue attacking otherwise reset threat and go home