diff --git a/Source/Game/DungeonFinding/LFGManager.cs b/Source/Game/DungeonFinding/LFGManager.cs
index 78b0da84a..1bf13ce4a 100644
--- a/Source/Game/DungeonFinding/LFGManager.cs
+++ b/Source/Game/DungeonFinding/LFGManager.cs
@@ -1323,7 +1323,7 @@ namespace Game.DungeonFinding
player.FinishTaxiFlight();
- if (!player.TeleportTo(mapid, x, y, z, orientation))
+ if (!player.TeleportTo(new Game.Entities.TeleportLocation(){ Location = new WorldLocation(mapid, x, y, z, orientation), LfgDungeonsId = dungeon.id }))
error = LfgTeleportResult.NoReturnLocation;
}
else
diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs
index 985f3b876..c200623dd 100644
--- a/Source/Game/Entities/Player/Player.cs
+++ b/Source/Game/Entities/Player/Player.cs
@@ -8061,7 +8061,8 @@ namespace Game.Entities
public class TeleportLocation
{
public WorldLocation Location;
- public uint? InstanceId;
public ObjectGuid? TransportGuid;
+ public uint? InstanceId;
+ public uint? LfgDungeonsId;
}
}
\ No newline at end of file
diff --git a/Source/Game/Handlers/MovementHandler.cs b/Source/Game/Handlers/MovementHandler.cs
index d46f1d107..34c575542 100644
--- a/Source/Game/Handlers/MovementHandler.cs
+++ b/Source/Game/Handlers/MovementHandler.cs
@@ -263,7 +263,7 @@ namespace Game
player.m_InstanceValid = true;
Map oldMap = player.GetMap();
- Map newMap = loc.InstanceId.HasValue ? Global.MapMgr.FindMap(loc.Location.GetMapId(), loc.InstanceId.Value) : Global.MapMgr.CreateMap(loc.Location.GetMapId(), GetPlayer());
+ Map newMap = loc.InstanceId.HasValue ? Global.MapMgr.FindMap(loc.Location.GetMapId(), loc.InstanceId.Value) : Global.MapMgr.CreateMap(loc.Location.GetMapId(), GetPlayer(), loc.LfgDungeonsId);
ITransport transport = player.GetTransport();
if (transport != null)
diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs
index 2fa2cd6d7..c892ee45f 100644
--- a/Source/Game/Maps/Map.cs
+++ b/Source/Game/Maps/Map.cs
@@ -4871,9 +4871,10 @@ namespace Game.Maps
public class InstanceMap : Map
{
- public InstanceMap(uint id, long expiry, uint InstanceId, Difficulty spawnMode, int instanceTeam, InstanceLock instanceLock) : base(id, expiry, InstanceId, spawnMode)
+ public InstanceMap(uint id, long expiry, uint InstanceId, Difficulty spawnMode, int instanceTeam, InstanceLock instanceLock, uint? lfgDungeonsId) : base(id, expiry, InstanceId, spawnMode)
{
i_instanceLock = instanceLock;
+ i_lfgDungeonsId = lfgDungeonsId;
//lets initialize visibility distance for dungeons
InitVisibilityDistance();
@@ -5270,6 +5271,8 @@ namespace Game.Maps
public Team GetTeamInInstance() { return GetTeamIdInInstance() == BattleGroundTeamId.Alliance ? Team.Alliance : Team.Horde; }
+ public uint? GetLfgDungeonsId() { return i_lfgDungeonsId; }
+
public uint GetScriptId()
{
return i_script_id;
@@ -5296,6 +5299,7 @@ namespace Game.Maps
InstanceScenario i_scenario;
InstanceLock i_instanceLock;
GroupInstanceReference i_owningGroupRef = new();
+ uint? i_lfgDungeonsId;
DateTime? i_instanceExpireEvent;
}
diff --git a/Source/Game/Maps/MapManager.cs b/Source/Game/Maps/MapManager.cs
index b65c59338..d61a2f315 100644
--- a/Source/Game/Maps/MapManager.cs
+++ b/Source/Game/Maps/MapManager.cs
@@ -57,7 +57,7 @@ namespace Game.Entities
return map;
}
- InstanceMap CreateInstance(uint mapId, uint instanceId, InstanceLock instanceLock, Difficulty difficulty, int team, Group group)
+ InstanceMap CreateInstance(uint mapId, uint instanceId, InstanceLock instanceLock, Difficulty difficulty, int team, Group group, uint? lfgDungeonsId)
{
// make sure we have a valid map id
var entry = CliDB.MapStorage.LookupByKey(mapId);
@@ -73,7 +73,7 @@ namespace Game.Entities
Log.outDebug(LogFilter.Maps, $"MapInstanced::CreateInstance: {(instanceLock?.IsNew() == true ? "new" : " ")} map instance {instanceId} for {mapId} created with difficulty {difficulty}");
- InstanceMap map = new InstanceMap(mapId, i_gridCleanUpDelay, instanceId, difficulty, team, instanceLock);
+ InstanceMap map = new InstanceMap(mapId, i_gridCleanUpDelay, instanceId, difficulty, team, instanceLock, lfgDungeonsId);
Cypher.Assert(map.IsDungeon());
map.LoadRespawnTimes();
@@ -122,9 +122,9 @@ namespace Game.Entities
///
///
///
- ///
+ ///
/// the right instance for the object, based on its InstanceId
- public Map CreateMap(uint mapId, Player player)
+ public Map CreateMap(uint mapId, Player player, uint? lfgDungeonsId = null)
{
if (player == null)
return null;
@@ -199,7 +199,7 @@ namespace Game.Entities
if (map == null)
{
- map = CreateInstance(mapId, newInstanceId, instanceLock, difficulty, SharedConst.GetTeamIdForTeam(Global.CharacterCacheStorage.GetCharacterTeamByGuid(instanceOwnerGuid)), group);
+ map = CreateInstance(mapId, newInstanceId, instanceLock, difficulty, SharedConst.GetTeamIdForTeam(Global.CharacterCacheStorage.GetCharacterTeamByGuid(instanceOwnerGuid)), group, lfgDungeonsId);
if (group != null)
group.SetRecentInstance(mapId, instanceOwnerGuid, newInstanceId);
else