aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpp- <spp@jorge.gr>2011-09-14 10:16:14 +0200
committerSpp- <spp@jorge.gr>2011-09-14 10:16:14 +0200
commit49686075c37d5915936faf59770745f201916c7d (patch)
tree9afee20b079f5207d42554a96145ae82d808d672 /src
parent33ce07bdde6a6dfc4c60971c1a7ec8e0c9c9aafe (diff)
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
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp14
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/MiscHandler.cpp6
2 files changed, 9 insertions, 11 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index ca5c3f2f132..9b82eff1b5c 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -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)
diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
index 4ee91aaae19..da6edc34832 100755
--- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp
@@ -922,9 +922,11 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
return;
// Check if we are in LfgGroup and trying to get out the dungeon
+ bool teleported = false;
if (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->isLFGGroup() && GetPlayer()->GetMap()->IsDungeon() && at->target_mapId != GetPlayer()->GetMapId())
- GetPlayer()->TeleportToBGEntryPoint();
- else
+ teleported = GetPlayer()->TeleportToBGEntryPoint();
+
+ if (!teleported)
GetPlayer()->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation, TELE_TO_NOT_LEAVE_TRANSPORT);
}