fix(Core/LFG): Properly teleport players to new instance if queued within the same dungeon. (#8174)

- Closes #8121
This commit is contained in:
UltraNix
2021-10-04 15:48:51 +02:00
committed by GitHub
parent 3aadaa6d0f
commit 495ca76628

View File

@@ -1651,8 +1651,10 @@ namespace lfg
}
bool randomDungeon = false;
std::vector<Player*> playersTeleported;
// Teleport Player
for (GuidUnorderedSet::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it)
{
if (Player* player = ObjectAccessor::FindPlayer(*it))
{
if (player->GetGroup() != grp) // pussywizard: could not add because group was full (some shitness happened)
@@ -1689,8 +1691,14 @@ namespace lfg
sInstanceSaveMgr->PlayerUnbindInstance(player->GetGUID(), dungeon->map, player->GetDungeonDifficulty(), true);
}
TeleportPlayer(player, false, teleportLocation);
playersTeleported.push_back(player);
}
}
for (Player* player : playersTeleported)
{
TeleportPlayer(player, false, teleportLocation);
}
if (randomDungeon)
grp->AddLfgRandomInstanceFlag();