diff options
author | megamage <none@none> | 2009-03-08 11:36:10 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-08 11:36:10 -0600 |
commit | 985b7656bb8f7de1cb192410f2ee0495dd43ae91 (patch) | |
tree | ac10c887e7e80fe17956ee2ca0742c40f3d24389 /src/game/Player.cpp | |
parent | 88c050182cd2628984a0282f66256913cecd188b (diff) | |
parent | 0f8dee432c4eb78b466744b9e3e13266c6be19d7 (diff) |
*Merge.
--HG--
branch : trunk
rename : sql/updates/XXX_characters_auctionhouse.sql => sql/updates/1164_characters.sql
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e5de0154ad4..99e4cf04b1c 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17597,19 +17597,7 @@ void Player::HandleStealthedUnitsDetection() sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i)); #endif - // target aura duration for caster show only if target exist at caster client - // send data at target visibility change (adding to client) - if((*i)!=this && (*i)->isType(TYPEMASK_UNIT)) - { - SendAurasForTarget(*i); - //if(((Unit*)(*i))->isAlive()) //should be always alive - { - if((*i)->GetTypeId()==TYPEID_UNIT) - ((Creature*)(*i))->SendMonsterMoveWithSpeedToCurrentDestination(this); - if(((Unit*)(*i))->getVictim()) - ((Unit*)(*i))->SendAttackStart(((Unit*)(*i))->getVictim()); - } - } + SendInitialVisiblePackets(*i); } } } @@ -18710,21 +18698,24 @@ void Player::UpdateVisibilityOf(WorldObject* target) // target aura duration for caster show only if target exist at caster client // send data at target visibility change (adding to client) - if(target!=this && target->isType(TYPEMASK_UNIT)) - { - SendAurasForTarget((Unit*)target); - if(((Unit*)target)->isAlive()) - { - if(target->GetTypeId()==TYPEID_UNIT) - ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this); - if(((Unit*)target)->getVictim()) - ((Unit*)target)->SendAttackStart(((Unit*)target)->getVictim()); - } - } + if(target->isType(TYPEMASK_UNIT)) + SendInitialVisiblePackets((Unit*)target); } } } +void Player::SendInitialVisiblePackets(Unit* target) +{ + SendAurasForTarget(target); + if(target->isAlive()) + { + if(target->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) + target->SendMonsterMoveWithSpeedToCurrentDestination(this); + if(target->hasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim()) + target->SendAttackStart(target->getVictim()); + } +} + template<class T> inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, T* target) { |