Core/Dungeon Finder: Use areatrigger coords when trying to get out from a lfg dungeon using the portal after player have been disconnected and original coords have not been saved
This commit is contained in:
@@ -2326,6 +2326,9 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
|
||||
bool Player::TeleportToBGEntryPoint()
|
||||
{
|
||||
if (m_bgData.joinPos.m_mapId == MAPID_INVALID)
|
||||
return false;
|
||||
|
||||
ScheduleDelayedOperation(DELAYED_BG_MOUNT_RESTORE);
|
||||
ScheduleDelayedOperation(DELAYED_BG_TAXI_RESTORE);
|
||||
return TeleportTo(m_bgData.joinPos);
|
||||
@@ -20961,7 +20964,6 @@ void Player::SetBattlegroundEntryPoint()
|
||||
|
||||
// On taxi we don't need check for dungeon
|
||||
m_bgData.joinPos = WorldLocation(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -20981,23 +20983,17 @@ void Player::SetBattlegroundEntryPoint()
|
||||
if (GetMap()->IsDungeon())
|
||||
{
|
||||
if (const WorldSafeLocsEntry* entry = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()))
|
||||
{
|
||||
m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f);
|
||||
return;
|
||||
}
|
||||
else
|
||||
sLog->outError("SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId());
|
||||
}
|
||||
// If new entry point is not BG or arena set it
|
||||
else if (!GetMap()->IsBattlegroundOrArena())
|
||||
{
|
||||
m_bgData.joinPos = WorldLocation(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// In error cases use homebind position
|
||||
m_bgData.joinPos = WorldLocation(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, 0.0f);
|
||||
if (m_bgData.joinPos.m_mapId == MAPID_INVALID) // In error cases use homebind position
|
||||
m_bgData.joinPos = WorldLocation(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, 0.0f);
|
||||
}
|
||||
|
||||
void Player::LeaveBattleground(bool teleportToEntryPoint)
|
||||
|
||||
Reference in New Issue
Block a user