*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:
@@ -610,7 +610,9 @@ 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());
|
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId());
|
||||||
if(at)
|
if(at)
|
||||||
@@ -618,6 +620,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
|||||||
else
|
else
|
||||||
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
|
pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ObjectAccessor::Instance().AddObject(pCurrChar);
|
ObjectAccessor::Instance().AddObject(pCurrChar);
|
||||||
//sLog.outDebug("Player %s added to Map.",pCurrChar->GetName());
|
//sLog.outDebug("Player %s added to Map.",pCurrChar->GetName());
|
||||||
|
|||||||
@@ -179,13 +179,18 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
|
|||||||
map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty());
|
map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty());
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
else
|
else if(!player->GetSession()->PlayerLoading())
|
||||||
{
|
{
|
||||||
// if no instanceId via group members or instance saves is found
|
// if no instanceId via group members or instance saves is found
|
||||||
// the instance will be created for the first time
|
// the instance will be created for the first time
|
||||||
NewInstanceId = MapManager::Instance().GenerateInstanceId();
|
NewInstanceId = MapManager::Instance().GenerateInstanceId();
|
||||||
return CreateInstance(NewInstanceId, NULL, player->GetDifficulty());
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user