aboutsummaryrefslogtreecommitdiff
path: root/src/game/Map.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-19 23:31:02 -0600
committermegamage <none@none>2008-12-19 23:31:02 -0600
commitac9e2ac6d28c69f37bdaa49e2226a9cf66670f9b (patch)
tree7cb2280d9fd4151d08efad98660a1f4ee391aa31 /src/game/Map.cpp
parentd7c37e157a37cb4bdfc7bec99796021f502c8e1f (diff)
*Update relocation notify code. Only notify units within max visible distance.
*Delete a duplicated config option. --HG-- branch : trunk
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r--src/game/Map.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 81dac274b1c..2ecb350beb5 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -656,12 +656,22 @@ void Map::Update(const uint32 &t_diff)
unit->m_Notified = true;
if(!unit->IsInWorld())
continue;
- CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
- Cell cell(val);
+ //CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
+ //Cell cell(val);
+ //if(unit->GetTypeId() == TYPEID_PLAYER)
+ // PlayerRelocationNotify((Player*)unit, cell, val);
+ //else
+ // CreatureRelocationNotify((Creature*)unit, cell, val);
if(unit->GetTypeId() == TYPEID_PLAYER)
- PlayerRelocationNotify((Player*)unit, cell, val);
+ {
+ Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
+ VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
+ }
else
- CreatureRelocationNotify((Creature*)unit, cell, val);
+ {
+ Trinity::CreatureRelocationNotifier notifier(*((Creature*)unit));
+ VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
+ }
}
for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
{