diff options
author | megamage <none@none> | 2008-11-20 20:28:17 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-11-20 20:28:17 -0600 |
commit | 5528b7c512ef7968b11ea93a48364a58b629b18b (patch) | |
tree | 92dde452da86b70d73af90c3acfecf64b4bc04ca /src/game/Creature.cpp | |
parent | 2c95ee4b31962198e3e6803bf56fe604724a2111 (diff) |
*Fix the bug that updatepacket is not sent to players.
*TODO: move creature::update to map::update. This requires that move activeobjectlist to map.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 68b8ab1feae..33d1fd2ea02 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1822,6 +1822,29 @@ void Creature::DoFleeToGetAssistance(float radius) // Optional parameter } } +Unit* Creature::SelectNearestTarget(float dist) const +{ + /*CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Unit *target; + + { + Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist); + Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck> searcher(target, u_check); + + TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor<Trinity::UnitLastSearcher<Trinity::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); + + CellLock<GridReadGuard> cell_lock(cell, p); + cell_lock->Visit(cell_lock, world_unit_searcher, GetMap()); + cell_lock->Visit(cell_lock, grid_unit_searcher, GetMap()); + }*/ + return NULL; +} + void Creature::CallAssistence() { if( !m_AlreadyCallAssistence && getVictim() && !isPet() && !isCharmed()) |