mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-18 22:09:40 -04:00
Core/Battleground: fix re-enter into battleground after disconnect
This commit is contained in:
@@ -1245,8 +1245,6 @@ void Battleground::EventPlayerLoggedOut(Player* player)
|
||||
if (GetAlivePlayersCountByTeam(player->GetTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetTeam())))
|
||||
EndBattleground(GetOtherTeam(player->GetTeam()));
|
||||
}
|
||||
|
||||
player->LeaveBattleground();
|
||||
}
|
||||
|
||||
// This method should be called only once ... it adds pointer to queue
|
||||
|
||||
@@ -16659,10 +16659,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
|
||||
if (player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE)
|
||||
{
|
||||
BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(true), currentBg->GetArenaType());
|
||||
BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
|
||||
AddBattlegroundQueueId(bgQueueTypeId);
|
||||
|
||||
m_bgData.bgTypeID = currentBg->GetTypeID(true);
|
||||
m_bgData.bgTypeID = currentBg->GetTypeID();
|
||||
|
||||
//join player to battleground group
|
||||
currentBg->EventPlayerLoggedIn(this);
|
||||
@@ -16834,7 +16834,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
}
|
||||
|
||||
// if the player is in an instance and it has been reset in the meantime teleport him to the entrance
|
||||
if (instanceId && !sInstanceSaveMgr->GetInstanceSave(instanceId))
|
||||
if (instanceId && !sInstanceSaveMgr->GetInstanceSave(instanceId) && !map->IsBattlegroundOrArena())
|
||||
{
|
||||
AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(mapId);
|
||||
if (at)
|
||||
|
||||
@@ -124,9 +124,17 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player)
|
||||
// the instance id is set in battlegroundid
|
||||
NewInstanceId = player->GetBattlegroundId();
|
||||
if (!NewInstanceId) return NULL;
|
||||
map = FindInstanceMap(NewInstanceId);
|
||||
map = sMapMgr->FindMap(mapId, NewInstanceId);
|
||||
if (!map)
|
||||
map = CreateBattleground(NewInstanceId, player->GetBattleground());
|
||||
{
|
||||
if (Battleground* bg = player->GetBattleground())
|
||||
map = CreateBattleground(NewInstanceId, bg);
|
||||
else
|
||||
{
|
||||
player->TeleportToBGEntryPoint();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user