aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-06 10:21:10 -0500
committermegamage <none@none>2009-08-06 10:21:10 -0500
commit048665a37a4b5b0649b68832e8fefd5d9b727fce (patch)
tree03cfd9424b8d1eef70a579de374b8852d8604012 /src/game/Player.cpp
parentd4dca0c8cdf41225d61f1309ee2d238024197a74 (diff)
*Try to fix the crash caused by invalid map pointer of player.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9964d69d051..046332847a9 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1621,6 +1621,21 @@ void Player::SendTeleportAckMsg()
GetSession()->SendPacket(&data);
}
+void Player::TeleportOutOfMap(Map *oldMap)
+{
+ if(FindMap() != oldMap)
+ return;
+
+ TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
+
+ if(FindMap() == oldMap)
+ {
+ sLog.outCrash("Cannot teleport player out of map!");
+ ResetMap();
+ assert(false);
+ }
+}
+
bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options)
{
if(!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))