aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2019-10-06 22:24:13 +0200
committerAokromes <Aokromes@users.noreply.github.com>2019-10-06 22:24:13 +0200
commitabcad7cda5375478f475bb9624c578169e84c559 (patch)
treefecdd438a6143c811d6b94363a994ab1ae5953a0 /src
parentada4e431ae77cf56e6f5e4441b494dd25d6b3fb9 (diff)
Core/LFG: Fix re-queueing while in a dungeon (#23862)
Fix an issue that wouldn't allow to re-queue after joining a dungeon, having 1 member leave/get kicked, queue, leave, queue. In this case a message "One or more dungeons was not valid" would be displayed because LFG would try to queue the group as "continue dungeon" but the current group was not marked as "in dungeon" state anymore.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 9dba4371040..a057c10cab9 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -619,13 +619,22 @@ void LFGMgr::LeaveLfg(ObjectGuid guid, bool disconnected)
case LFG_STATE_QUEUED:
if (gguid)
{
+ LfgState newState = LFG_STATE_NONE;
+ LfgState oldState = GetOldState(gguid);
+
+ // Set the new state to LFG_STATE_DUNGEON/LFG_STATE_FINISHED_DUNGEON if the group is already in a dungeon
+ // This is required in case a LFG group vote-kicks a player in a dungeon, queues, then leaves the queue (maybe to queue later again)
+ if (Group* group = sGroupMgr->GetGroupByGUID(gguid.GetCounter()))
+ if (group->isLFGGroup() && GetDungeon(gguid) && (oldState == LFG_STATE_DUNGEON || oldState == LFG_STATE_FINISHED_DUNGEON))
+ newState = oldState;
+
LFGQueue& queue = GetQueue(gguid);
queue.RemoveFromQueue(gguid);
- SetState(gguid, LFG_STATE_NONE);
+ SetState(gguid, newState);
GuidSet const& players = GetPlayers(gguid);
for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
{
- SetState(*it, LFG_STATE_NONE);
+ SetState(*it, newState);
SendLfgUpdateParty(*it, LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE));
}
}