mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
*Fix the bug that creating new instance during login causes crash.
--HG-- branch : trunk
This commit is contained in:
@@ -610,16 +610,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
}
|
||||
}
|
||||
|
||||
if (!pCurrChar->GetMap()->Add(pCurrChar))
|
||||
{
|
||||
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());
|
||||
}
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user