aboutsummaryrefslogtreecommitdiff
path: root/src/game/CharacterHandler.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-03 17:06:31 -0600
committermegamage <none@none>2008-12-03 17:06:31 -0600
commitb36929bc79c164d2a0e727d35445d7c700b5d762 (patch)
treea5eaaad8494426a8ff6e541d41c2d8867760133d /src/game/CharacterHandler.cpp
parent08d259e0cc3ed1c9b7addee6ad3595776a8af1c3 (diff)
*Do not create new instance when player is logging in. (Try to fix "Instance Relog & Reset Exploit")
--HG-- branch : trunk
Diffstat (limited to 'src/game/CharacterHandler.cpp')
-rw-r--r--src/game/CharacterHandler.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index 40f3fb8e530..19a445decfc 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -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);