From 9b0c7129465bfc98e13d6f7b0596d1e0c089ef01 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 30 Aug 2009 23:51:11 -0500 Subject: *Fix a crash caused by invalid mapid in player save. Thanks to Visagalis --HG-- branch : trunk --- src/game/Player.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3