aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2018-08-28 12:18:19 +0200
committerjackpoz <giacomopoz@gmail.com>2018-08-28 12:18:19 +0200
commitbf8c6f220c07a3316fcf0b04ac6a9a77755b9b1d (patch)
tree67c12effa6cca0a020e893f738c21d4ff13ff432
parent2c030ed5e7dc809e384415716789e0a663352d16 (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).
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 37fd98570e4..7fadc85a868 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -958,8 +958,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);
+ const LfgDungeonSet& dungeons = GetSelectedDungeons(player->GetGUID());
+ if (!dungeons.empty())
+ {
+ uint32 rDungeonId = (*dungeons.begin());
+ LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(rDungeonId);
+ if (dungeon && dungeon->type == LFG_TYPE_RANDOM)
+ player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false);
+ }
}
ASSERT(grp);