diff options
author | gvcoman <none@none> | 2008-11-07 16:49:42 -0600 |
---|---|---|
committer | gvcoman <none@none> | 2008-11-07 16:49:42 -0600 |
commit | e18c77155311ff47b2609c37ccf9abda43d6e3a5 (patch) | |
tree | 9849bf2e2d595b02356cddf5354b4826342c739e /src/game/Player.cpp | |
parent | 46bb829582d9bc5ccb526fc7314dbbea0e615fa1 (diff) |
[svn] Possession:
* Fixed player not having PvP flag on remove
* Fixed pet resetting its aggro on remove
* Fixed pet bar resetting on remove (?)
* Added dummy handler for NOT_ACTIVE_MOVER, display message only in debug logging mode
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 12d1dd99941..9ef583416c6 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18660,6 +18660,8 @@ void Player::Possess(Unit *target) // Update the proper unit fields SetPossessedTarget(target); + uint32 flags1 = target->GetUInt32Value(UNIT_FIELD_FLAGS); + target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction()); target->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); @@ -18667,6 +18669,8 @@ void Player::Possess(Unit *target) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); SetUInt64Value(PLAYER_FARSIGHT, target->GetGUID()); + uint32 flags2 = target->GetUInt32Value(UNIT_FIELD_FLAGS); + if(target->GetTypeId() == TYPEID_UNIT) { // Set target to active in the grid and place it in the world container to be picked up by all regular player cell visits @@ -18720,6 +18724,10 @@ void Player::RemovePossess(bool attack) ++itr; } + // Interrupt any current casting of the target + if(target->IsNonMeleeSpellCasted(true)) + target->InterruptNonMeleeSpells(true); + RemovePossessedTarget(); if(target->GetTypeId() == TYPEID_PLAYER) @@ -18743,7 +18751,6 @@ void Player::RemovePossess(bool attack) } target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5); - target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); SetUInt64Value(PLAYER_FARSIGHT, 0); @@ -18758,18 +18765,14 @@ void Player::RemovePossess(bool attack) ((Player*)target)->SetViewport(target->GetGUID(), true); else { + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); if(((Creature*)target)->isPet()) - { - ((Pet*)target)->InitPetCreateSpells(); PetSpellInitialize(); - } - - if (target->isAlive()) + else if (target->isAlive()) { // If we're still hostile to our target, continue attacking otherwise reset threat and go home - if (target->getVictim()) + if (Unit* victim = target->getVictim()) { - Unit* victim = target->getVictim(); FactionTemplateEntry const* t_faction = target->getFactionTemplateEntry(); FactionTemplateEntry const* v_faction = victim->getFactionTemplateEntry(); // Unit::IsHostileTo will always return true since the unit is always hostile to its victim @@ -18783,14 +18786,14 @@ void Player::RemovePossess(bool attack) target->GetMotionMaster()->MoveTargetedHome(); } } - else if (target->GetTypeId() == TYPEID_UNIT) + else { target->GetMotionMaster()->Clear(); target->GetMotionMaster()->MoveTargetedHome(); } // Add high amount of threat on the player - if(target != GetPet() && attack) + if(attack) target->AddThreat(this, 1000000.0f); } // Delete the assigned possessed AI |