mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-03 23:57:10 +01:00
Core/Maps: Link instance map to LfgDungeons
This commit is contained in:
@@ -86,7 +86,8 @@ Map* MapManager::CreateWorldMap(uint32 mapId, uint32 instanceId)
|
||||
return map;
|
||||
}
|
||||
|
||||
InstanceMap* MapManager::CreateInstance(uint32 mapId, uint32 instanceId, InstanceLock* instanceLock, Difficulty difficulty, TeamId team, Group* group)
|
||||
InstanceMap* MapManager::CreateInstance(uint32 mapId, uint32 instanceId, InstanceLock* instanceLock, Difficulty difficulty, TeamId team, Group* group,
|
||||
Optional<uint32> lfgDungeonsId)
|
||||
{
|
||||
// make sure we have a valid map id
|
||||
MapEntry const* entry = sMapStore.LookupEntry(mapId);
|
||||
@@ -102,7 +103,7 @@ InstanceMap* MapManager::CreateInstance(uint32 mapId, uint32 instanceId, Instanc
|
||||
TC_LOG_DEBUG("maps", "MapInstanced::CreateInstance: {}map instance {} for {} created with difficulty {}",
|
||||
instanceLock && instanceLock->IsNew() ? "" : "new ", instanceId, mapId, sDifficultyStore.AssertEntry(difficulty)->Name[sWorld->GetDefaultDbcLocale()]);
|
||||
|
||||
InstanceMap* map = new InstanceMap(mapId, i_gridCleanUpDelay, instanceId, difficulty, team, instanceLock);
|
||||
InstanceMap* map = new InstanceMap(mapId, i_gridCleanUpDelay, instanceId, difficulty, team, instanceLock, lfgDungeonsId);
|
||||
ASSERT(map->IsDungeon());
|
||||
|
||||
map->LoadRespawnTimes();
|
||||
@@ -150,7 +151,7 @@ GarrisonMap* MapManager::CreateGarrison(uint32 mapId, uint32 instanceId, Player*
|
||||
- create the instance if it's not created already
|
||||
- the player is not actually added to the instance (only in InstanceMap::Add)
|
||||
*/
|
||||
Map* MapManager::CreateMap(uint32 mapId, Player* player)
|
||||
Map* MapManager::CreateMap(uint32 mapId, Player* player, Optional<uint32> lfgDungeonsId /*= {}*/)
|
||||
{
|
||||
if (!player)
|
||||
return nullptr;
|
||||
@@ -225,7 +226,8 @@ Map* MapManager::CreateMap(uint32 mapId, Player* player)
|
||||
|
||||
if (!map)
|
||||
{
|
||||
map = CreateInstance(mapId, newInstanceId, instanceLock, difficulty, GetTeamIdForTeam(sCharacterCache->GetCharacterTeamByGuid(instanceOwnerGuid)), group);
|
||||
map = CreateInstance(mapId, newInstanceId, instanceLock, difficulty, GetTeamIdForTeam(sCharacterCache->GetCharacterTeamByGuid(instanceOwnerGuid)), group,
|
||||
lfgDungeonsId);
|
||||
if (group)
|
||||
group->SetRecentInstance(mapId, instanceOwnerGuid, newInstanceId);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user