diff options
author | megamage <none@none> | 2009-08-30 23:51:11 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-30 23:51:11 -0500 |
commit | 9b0c7129465bfc98e13d6f7b0596d1e0c089ef01 (patch) | |
tree | 7c094f4a16ca4778883a067a8c8eb5bc7c1094ea | |
parent | d8971e58f24265de614d54f5777fb50f5c1abbf5 (diff) |
*Fix a crash caused by invalid mapid in player save. Thanks to Visagalis
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 11ff3011b4c..3e536625887 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14822,9 +14822,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) _LoadBGData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADBGDATA)); MapEntry const * mapEntry = sMapStore.LookupEntry(mapId); - if(!IsPositionValid()) + if(!mapEntry || !IsPositionValid()) { - sLog.outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); + sLog.outError("Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); RelocateToHomebind(); } // Player was saved in Arena or Bg @@ -14950,7 +14950,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // Map could be changed before mapEntry = sMapStore.LookupEntry(mapId); // client without expansion support - if(GetSession()->Expansion() < mapEntry->Expansion()) + if(mapEntry && GetSession()->Expansion() < mapEntry->Expansion()) { sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); RelocateToHomebind(); |