*Do not create new instance when player is logging in. (Try to fix "Instance Relog & Reset Exploit")

--HG--
branch : trunk
This commit is contained in:
megamage committed 2008-12-03 17:06:31 -06:00
1 parent 08d259e0cc
commit b36929bc79
2 files changed
+15 -7

No files matched your search

+9 -6
View File
@@ -610,13 +610,16 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
}
}
if (!pCurrChar->GetMap()->Add(pCurrChar))
{
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId());
if(at)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
else
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
Map *map = pCurrChar->GetMap();
if (!map || !map->Add(pCurrChar))
{
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId());
if(at)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
else
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
}
}
ObjectAccessor::Instance().AddObject(pCurrChar);