aboutsummaryrefslogtreecommitdiff
path: root/src/game/CharacterHandler.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-04 10:56:50 -0600
committermegamage <none@none>2008-12-04 10:56:50 -0600
commitbd25d2a33b847cbf4fa3a5d3afb381da8baa3802 (patch)
treeded50bcef953cdbcc6a025ce1a2bacbff2186fd5 /src/game/CharacterHandler.cpp
parent2d1905c887ba9eaa139dd450a484ed53868ec627 (diff)
*Fix the bug that creating new instance during login causes crash.
--HG-- branch : trunk
Diffstat (limited to 'src/game/CharacterHandler.cpp')
-rw-r--r--src/game/CharacterHandler.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index 19a445decfc..40f3fb8e530 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -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);