diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/CharacterHandler.cpp | 15 | ||||
-rw-r--r-- | src/game/MapInstanced.cpp | 7 |
2 files changed, 15 insertions, 7 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); diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index 7b8f5fb9b64..06d38ed791a 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -179,13 +179,18 @@ Map* MapInstanced::GetInstance(const WorldObject* obj) map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty()); return map; } - else + else if(!player->GetSession()->PlayerLoading()) { // if no instanceId via group members or instance saves is found // the instance will be created for the first time NewInstanceId = MapManager::Instance().GenerateInstanceId(); return CreateInstance(NewInstanceId, NULL, player->GetDifficulty()); } + else + { + sLog.outError("MAPINSTANCED: Player %s is trying to create instance (MapId %u) when login.", player->GetName(), player->GetMapId()); + return NULL; + } } } } |