Skip to content

Commit

Permalink
Fix infinite BG queue after relog.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed May 13, 2024
1 parent f60eda7 commit 91a4f32
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/game/Battlegrounds/BattleGroundMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,7 @@ void BattleGroundMgr::LoadBattleEventIndexes()
void BattleGroundMgr::PlayerLoggedIn(Player* player)
{
for (int i = 1; i <= PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
{
if (m_battleGroundQueues[i].PlayerLoggedIn(player))
{
GroupQueueInfo groupInfo;
Expand All @@ -1677,8 +1678,16 @@ void BattleGroundMgr::PlayerLoggedIn(Player* player)
player->GetSession()->SendPacket(&data);

if (groupInfo.isInvitedToBgInstanceGuid)
{
player->SetInviteForBattleGroundQueueType(BattleGroundQueueTypeId(i), groupInfo.isInvitedToBgInstanceGuid);

// create automatic remove events
BGQueueRemoveEvent* removeEvent = new BGQueueRemoveEvent(player->GetObjectGuid(), groupInfo.isInvitedToBgInstanceGuid, bg->GetTypeID(), BattleGroundQueueTypeId(i), groupInfo.removeInviteTime);
uint32 offset = (WorldTimer::getMSTime() > groupInfo.removeInviteTime) ? 1 : WorldTimer::getMSTimeDiff(WorldTimer::getMSTime(), groupInfo.removeInviteTime);
player->m_Events.AddEvent(removeEvent, player->m_Events.CalculateTime(offset));
}
}
}
}

void BattleGroundMgr::PlayerLoggedOut(Player* player)
Expand Down

0 comments on commit 91a4f32

Please sign in to comment.