[7333] Refactoring DestinationHolder/Traveler/Unit::SendMonsterMoveWithSpeed code. Author: VladimirMangos

* Move common code in appropriate functions.
    * Correct select speed and 2D/3D distance for creature/player walk/fly

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-26 20:35:40 -06:00
parent 0f9238ecb1
commit 85d5d94e71
9 changed files with 71 additions and 43 deletions

View File

@@ -142,11 +142,17 @@ VisibleNotifier::Notify()
// Now do operations that required done at object visibility change to visible
// target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
{
// target aura duration for caster show only if target exist at caster client
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
i_player.SendAurasForTarget((Unit*)(*vItr));
// non finished movements show to player
if((*vItr)->GetTypeId()==TYPEID_UNIT && ((Creature*)(*vItr))->isAlive())
((Creature*)(*vItr))->SendMonsterMoveWithSpeedToCurrentDestination(&i_player);
}
}
void