*Fix the bug that player cannot see other units after changing map (the last rev does not work).

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-23 22:10:59 -06:00
parent 8a6277dab2
commit c62acd32f8
4 changed files with 9 additions and 4 deletions
+1
View File
@@ -195,6 +195,7 @@ scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp \
scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h \ scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h \
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \ scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \ scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp \
scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \ scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \
scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h \ scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h \
scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp \ scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp \
+5 -1
View File
@@ -797,6 +797,10 @@ void Map::Update(const uint32 &t_diff)
void Map::Remove(Player *player, bool remove) void Map::Remove(Player *player, bool remove)
{ {
player->DestroyForNearbyPlayers();
player->m_IsInNotifyList = false;
player->m_Notified = false;
// this may be called during Map::Update // this may be called during Map::Update
// after decrement+unlink, ++m_mapRefIter will continue correctly // after decrement+unlink, ++m_mapRefIter will continue correctly
// when the first element of the list is being removed // when the first element of the list is being removed
@@ -835,7 +839,7 @@ void Map::Remove(Player *player, bool remove)
SendRemoveTransports(player); SendRemoveTransports(player);
//UpdateObjectsVisibilityFor(player,cell,p); //UpdateObjectsVisibilityFor(player,cell,p);
AddUnitToNotify(player); //AddUnitToNotify(player);
if( remove ) if( remove )
DeleteFromWorld(player); DeleteFromWorld(player);
+2 -2
View File
@@ -1735,7 +1735,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
ResetContestedPvP(); ResetContestedPvP();
DestroyForNearbyPlayers(); /*DestroyForNearbyPlayers();
{ {
UpdateData data; UpdateData data;
for(ClientGUIDs::iterator i = m_clientGUIDs.begin(); i != m_clientGUIDs.end(); ++i) for(ClientGUIDs::iterator i = m_clientGUIDs.begin(); i != m_clientGUIDs.end(); ++i)
@@ -1743,7 +1743,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
WorldPacket packet; WorldPacket packet;
data.BuildPacket(&packet); data.BuildPacket(&packet);
GetSession()->SendPacket(&packet); GetSession()->SendPacket(&packet);
} }*/
m_clientGUIDs.clear(); m_clientGUIDs.clear();
// remove player from battleground on far teleport (when changing maps) // remove player from battleground on far teleport (when changing maps)
+1 -1
View File
@@ -255,7 +255,7 @@ void WorldSession::LogoutPlayer(bool Save)
// Remove any possession of this player on logout // Remove any possession of this player on logout
_player->RemoveCharmedOrPossessedBy(NULL); _player->RemoveCharmedOrPossessedBy(NULL);
_player->DestroyForNearbyPlayers(); //_player->DestroyForNearbyPlayers();
if (uint64 lguid = GetPlayer()->GetLootGUID()) if (uint64 lguid = GetPlayer()->GetLootGUID())
DoLootRelease(lguid); DoLootRelease(lguid);