*Try to fix the bug that client get freezed when players teleported out of bg/arena.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-16 11:46:03 -06:00
parent abe53c5cb6
commit d6a1516057
+4 -4
View File
@@ -614,14 +614,14 @@ 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) if(!unit || !unit->IsInWorld() || !unit->GetMapId() == GetId())
{
*iter = 0;
continue; continue;
}
unit->m_Notified = true; unit->m_Notified = true;
if(!unit->IsInWorld())
continue;
if(unit->GetTypeId() == TYPEID_PLAYER) if(unit->GetTypeId() == TYPEID_PLAYER)
{ {
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit)); Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));