diff options
author | Ovah <dreadkiller@gmx.de> | 2018-08-28 12:18:19 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-10-23 14:37:37 +0200 |
commit | e88536f258dd187f1ee6855602501897138cf8b9 (patch) | |
tree | 4c11d9f5d25bb35069939bb4d1f14e1a905e3505 /src/server/game/DungeonFinding/LFGMgr.cpp | |
parent | dd239e8b0f945a70c9d738024bdc2d75d54575f4 (diff) |
Core/LFG: fixed random dungeon cooldown (#22321)
* Core/LFG: fixed random dungeon cooldown
The issue was that queuing up for random dungeons puts you into a queue for a already selected dungeon from the beginning so the dungeonId that we use here is actually the dungeonId that we will enter when out group is complete. We change that and use our selected dungeons as reference instead which contains the random dungeon at the very beginning (if we queued up for random dungeons so we check that too).
(cherry picked from commit bf8c6f220c07a3316fcf0b04ac6a9a77755b9b1d)
Diffstat (limited to 'src/server/game/DungeonFinding/LFGMgr.cpp')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 37f90c6e006..bb2a18d15ee 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -981,8 +981,14 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal) grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role); // Add the cooldown spell if queued for a random dungeon - if (dungeon->type == LFG_TYPE_RANDOM) - player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); + LfgDungeonSet const& dungeons = GetSelectedDungeons(player->GetGUID()); + if (!dungeons.empty()) + { + uint32 rDungeonId = (*dungeons.begin()); + LFGDungeonData const* dungeon = GetLFGDungeon(rDungeonId); + if (dungeon && dungeon->type == LFG_TYPE_RANDOM) + player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); + } } ASSERT(grp); |