*Some improvement of update visibility when players leave map.
--HG-- branch : trunk
This commit is contained in:
+16
-4
@@ -469,6 +469,8 @@ bool Map::Add(Player *player)
|
|||||||
SendInitSelf(player);
|
SendInitSelf(player);
|
||||||
SendInitTransports(player);
|
SendInitTransports(player);
|
||||||
|
|
||||||
|
player->m_IsInNotifyList = false;
|
||||||
|
player->m_Notified = false;
|
||||||
AddNotifier(player);
|
AddNotifier(player);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -614,12 +616,24 @@ void Map::RelocationNotify()
|
|||||||
for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||||
{
|
{
|
||||||
Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL);
|
Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL);
|
||||||
if(!unit || !unit->IsInWorld() || !unit->GetMapId() == GetId())
|
if(!unit || unit->GetMapId() != GetId())
|
||||||
{
|
{
|
||||||
*iter = 0;
|
*iter = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!unit->IsInWorld())
|
||||||
|
{
|
||||||
|
//other objs are done during remove
|
||||||
|
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
|
Trinity::VisibleChangesNotifier notifier(*unit);
|
||||||
|
VisitWorld(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||||
|
}
|
||||||
|
*iter = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
unit->m_Notified = true;
|
unit->m_Notified = true;
|
||||||
|
|
||||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||||
@@ -798,9 +812,7 @@ void Map::Update(const uint32 &t_diff)
|
|||||||
|
|
||||||
void Map::Remove(Player *player, bool remove)
|
void Map::Remove(Player *player, bool remove)
|
||||||
{
|
{
|
||||||
player->DestroyForNearbyPlayers();
|
AddUnitToNotify(player);
|
||||||
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
|
||||||
|
|||||||
@@ -1714,17 +1714,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
|||||||
|
|
||||||
ResetContestedPvP();
|
ResetContestedPvP();
|
||||||
|
|
||||||
/*DestroyForNearbyPlayers();
|
|
||||||
{
|
|
||||||
UpdateData data;
|
|
||||||
for(ClientGUIDs::iterator i = m_clientGUIDs.begin(); i != m_clientGUIDs.end(); ++i)
|
|
||||||
data.AddOutOfRangeGUID(*i);
|
|
||||||
WorldPacket packet;
|
|
||||||
data.BuildPacket(&packet);
|
|
||||||
GetSession()->SendPacket(&packet);
|
|
||||||
}*/
|
|
||||||
m_clientGUIDs.clear();
|
|
||||||
|
|
||||||
// remove player from battleground on far teleport (when changing maps)
|
// remove player from battleground on far teleport (when changing maps)
|
||||||
if(BattleGround const* bg = GetBattleGround())
|
if(BattleGround const* bg = GetBattleGround())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user