fix(Core/DungeonFinder): re-queueing being inside dungeon and member leaving DF (#7570)

- Closes #6790
This commit is contained in:
UltraNix
2021-08-31 23:37:49 +02:00
committed by GitHub
parent 9d81f3525f
commit bfaa32f253
2 changed files with 12 additions and 5 deletions

View File

@@ -551,11 +551,12 @@ namespace lfg
/// Sends queue status to player
static void SendLfgQueueStatus(ObjectGuid guid, LfgQueueStatusData const& data);
void SetDungeon(ObjectGuid guid, uint32 dungeon);
private:
TeamId GetTeam(ObjectGuid guid);
void RestoreState(ObjectGuid guid, char const* debugMsg);
void ClearState(ObjectGuid guid, char const* debugMsg);
void SetDungeon(ObjectGuid guid, uint32 dungeon);
void SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons);
void SetLockedDungeons(ObjectGuid guid, LfgLockMap const& lock);
void DecreaseKicksLeft(ObjectGuid guid);

View File

@@ -181,6 +181,7 @@ namespace lfg
bool isLFG = group->isLFGGroup();
LfgState state = sLFGMgr->GetState(gguid);
uint32 dungeonId = sLFGMgr->GetDungeon(gguid, false);
// If group is being formed after proposal success do nothing more
if (state == LFG_STATE_PROPOSAL && method == GROUP_REMOVEMETHOD_DEFAULT)
@@ -205,6 +206,15 @@ namespace lfg
if (!isLFG)
return;
if (state != LFG_STATE_FINISHED_DUNGEON && group) // Need more players to finish the dungeon
{
if (Player* leader = ObjectAccessor::FindConnectedPlayer(sLFGMgr->GetLeader(gguid)))
{
sLFGMgr->SetDungeon(gguid, dungeonId);
leader->GetSession()->SendLfgOfferContinue(sLFGMgr->GetDungeon(gguid, false));
}
}
if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
{
// xinef: fixed dungeon deserter
@@ -224,10 +234,6 @@ namespace lfg
player->TeleportToEntryPoint();
}
}
if (state != LFG_STATE_FINISHED_DUNGEON) // Need more players to finish the dungeon
if (Player* leader = ObjectAccessor::FindConnectedPlayer(sLFGMgr->GetLeader(gguid)))
leader->GetSession()->SendLfgOfferContinue(sLFGMgr->GetDungeon(gguid, false));
}
void LFGGroupScript::OnDisband(Group* group)