diff options
author | megamage <none@none> | 2009-08-06 10:21:10 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-06 10:21:10 -0500 |
commit | 048665a37a4b5b0649b68832e8fefd5d9b727fce (patch) | |
tree | 03cfd9424b8d1eef70a579de374b8852d8604012 /src/game/Player.cpp | |
parent | d4dca0c8cdf41225d61f1309ee2d238024197a74 (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.cpp | 15 |
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)) |