From 55ef3bca2ae79d87d2e08e80bf29eec38892545f Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 20 Dec 2008 17:42:40 -0600 Subject: *Update visibility only once per update. --HG-- branch : trunk --- src/game/Map.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/game/Map.cpp') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 152a078868b..531f32e75e9 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -476,8 +476,8 @@ bool Map::Add(Player *player) SendInitSelf(player); SendInitTransports(player); - UpdatePlayerVisibility(player,cell,p); - UpdateObjectsVisibilityFor(player,cell,p); + //UpdatePlayerVisibility(player,cell,p); + //UpdateObjectsVisibilityFor(player,cell,p); //AddNotifier(player,cell,p); AddUnitToNotify(player); @@ -664,14 +664,16 @@ 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) { + UpdatePlayerVisibility((Player*)unit, cell, val); + UpdateObjectsVisibilityFor((Player*)unit, cell, val); Trinity::PlayerRelocationNotifier notifier(*((Player*)unit)); VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); } @@ -891,8 +893,8 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati } // if move then update what player see and who seen - UpdatePlayerVisibility(player,new_cell,new_val); - UpdateObjectsVisibilityFor(player,new_cell,new_val); + //UpdatePlayerVisibility(player,new_cell,new_val); + //UpdateObjectsVisibilityFor(player,new_cell,new_val); // also update what possessing player sees if(player->isPossessedByPlayer()) -- cgit v1.2.3