diff options
| author | Spp <none@none> | 2010-11-22 12:28:06 +0100 |
|---|---|---|
| committer | Spp <none@none> | 2010-11-22 12:28:06 +0100 |
| commit | a7d262ce03e7e11c7799250eb6bbb62ea4f348aa (patch) | |
| tree | adfa5176f2846b05f563bddcd9c4da2a5becb1b0 /src/server/game/DungeonFinding/LFGMgr.cpp | |
| parent | a2ef7e18a18945588308c1cbfcb91e6aa7513dec (diff) | |
Core/Dungeon Finder: Do not allow to join if selected dungeons and raids
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/DungeonFinding/LFGMgr.cpp')
| -rwxr-xr-x | src/server/game/DungeonFinding/LFGMgr.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index efebdff7165..efb217ad803 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -570,14 +570,32 @@ void LFGMgr::Join(Player* plr) if (!dungeons || !dungeons->size()) result = LFG_JOIN_NOT_MEET_REQS; else // Check if all dungeons are valid + { + bool isDungeon = false; + bool isRaid = false; + LfgType type = LFG_TYPE_NONE; for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++it) { - if (!GetDungeonGroupType(*it)) + type = GetDungeonType(*it); + switch(type) { - result = LFG_JOIN_DUNGEON_INVALID; - break; + case LFG_TYPE_DUNGEON: + case LFG_TYPE_HEROIC: + if (isRaid) + result = LFG_JOIN_MIXED_RAID_DUNGEON; + isDungeon = true; + break; + case LFG_TYPE_RAID: + if (isDungeon) + result = LFG_JOIN_MIXED_RAID_DUNGEON; + isRaid = true; + break; + default: + result = LFG_JOIN_DUNGEON_INVALID; + break; } } + } } // Group checks @@ -614,7 +632,6 @@ void LFGMgr::Join(Player* plr) if (grp && !grp->isLFGGroup()) plr->SetLfgState(LFG_STATE_NONE); plr->GetSession()->SendLfgJoinResult(result); - plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_ROLECHECK_FAILED); return; } @@ -2174,17 +2191,17 @@ LfgReward const* LFGMgr::GetRandomDungeonReward(uint32 dungeon, uint8 level) } /// <summary> -/// Given a Dungeon id returns the dungeon Group Type +/// Given a Dungeon id returns the dungeon Type /// </summary> /// <param name="uint32">Dungeon id</param> -/// <returns>uint8: GroupType</returns> -uint8 LFGMgr::GetDungeonGroupType(uint32 dungeonId) +/// <returns>uint8: Type</returns> +LfgType LFGMgr::GetDungeonType(uint32 dungeonId) { LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId); if (!dungeon) - return 0; + return LFG_TYPE_NONE; - return dungeon->grouptype; + return LfgType(dungeon->type); } /// <summary> |
