diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index ca2e6fdfd..512f91885 100644 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -27,22 +27,6 @@ using namespace MaNGOS; -void -MaNGOS::PlayerNotifier::Visit(PlayerMapType &m) -{ - WorldObject const* viewPoint = i_player.GetViewPoint(); - - for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) - { - Player* player = iter->getSource(); - if( player == &i_player ) - continue; - - player->UpdateVisibilityOf(player->GetViewPoint(),&i_player); - i_player.UpdateVisibilityOf(viewPoint,player); - } -} - void VisibleChangesNotifier::Visit(PlayerMapType &m) { @@ -56,23 +40,6 @@ VisibleChangesNotifier::Visit(PlayerMapType &m) } } -void -VisibleNotifier::Visit(PlayerMapType &m) -{ - WorldObject const* viewPoint = i_player.GetViewPoint(); - - for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) - { - Player* player = iter->getSource(); - if( player == &i_player ) - continue; - - player->UpdateVisibilityOf(player->GetViewPoint(),&i_player); - i_player.UpdateVisibilityOf(viewPoint,player,i_data,i_data_updates,i_visibleNow); - i_clientGUIDs.erase(player->GetGUID()); - } -} - void VisibleNotifier::Notify() { diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 11debc165..000548b7b 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -36,15 +36,6 @@ class Player; namespace MaNGOS { - - struct MANGOS_DLL_DECL PlayerNotifier - { - explicit PlayerNotifier(Player &pl) : i_player(pl) {} - void Visit(PlayerMapType &); - template void Visit(GridRefManager &) {} - Player &i_player; - }; - struct MANGOS_DLL_DECL VisibleNotifier { Player &i_player; @@ -55,7 +46,6 @@ namespace MaNGOS explicit VisibleNotifier(Player &player) : i_player(player),i_clientGUIDs(player.m_clientGUIDs) {} template void Visit(GridRefManager &m); - void Visit(PlayerMapType &); void Notify(void); }; diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 0ec96ec2c..e01cfe891 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -444,7 +444,7 @@ bool Map::Add(Player *player) SendInitSelf(player); SendInitTransports(player); - UpdatePlayerVisibility(player,cell,p); + UpdateObjectVisibility(player,cell,p); UpdateObjectsVisibilityFor(player,cell,p); AddNotifier(player,cell,p); @@ -758,6 +758,7 @@ void Map::Remove(Player *player, bool remove) RemoveFromGrid(player,grid,cell); SendRemoveTransports(player); + UpdateObjectVisibility(player,cell,p); UpdateObjectsVisibilityFor(player,cell,p); player->ResetMap(); @@ -838,9 +839,10 @@ 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); + UpdateObjectVisibility(player, new_cell, new_val); PlayerRelocationNotify(player,new_cell,new_val); + NGridType* newGrid = getNGrid(new_cell.GridX(), new_cell.GridY()); if( !same_cell && newGrid->GetGridState()!= GRID_STATE_ACTIVE ) { @@ -2023,16 +2025,6 @@ void Map::UpdateObjectVisibility( WorldObject* obj, Cell cell, CellPair cellpair cell.Visit(cellpair, player_notifier, *this, *obj, GetVisibilityDistance()); } -void Map::UpdatePlayerVisibility( Player* player, Cell cell, CellPair cellpair ) -{ - cell.data.Part.reserved = ALL_DISTRICT; - - MaNGOS::PlayerNotifier pl_notifier(*player); - TypeContainerVisitor player_notifier(pl_notifier); - - cell.Visit(cellpair, player_notifier, *this, *player, GetVisibilityDistance()); -} - void Map::UpdateObjectsVisibilityFor( Player* player, Cell cell, CellPair cellpair ) { MaNGOS::VisibleNotifier notifier(*player); diff --git a/src/game/Map.h b/src/game/Map.h index a73cdee90..b9dae4c81 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -362,7 +362,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj void AddObjectToRemoveList(WorldObject *obj); void UpdateObjectVisibility(WorldObject* obj, Cell cell, CellPair cellpair); - void UpdatePlayerVisibility(Player* player, Cell cell, CellPair cellpair); void UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpair); void resetMarkedCells() { marked_cells.reset(); } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3453c56c2..a364520e8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -21929,7 +21929,7 @@ void Player::UpdateVisibilityForPlayer() CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY())); Cell cell(p); - m->UpdatePlayerVisibility(this, cell, p); + m->UpdateObjectVisibility(this, cell, p); if (this != viewPoint) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ac5aa4d49..4ea9f57a0 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9724" + #define REVISION_NR "9725" #endif // __REVISION_NR_H__