aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);