diff options
author | megamage <none@none> | 2009-08-08 19:05:44 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-08 19:05:44 -0500 |
commit | 2f83f6a79c21cef2dadeaa6ba19d36e163f49f57 (patch) | |
tree | 8ac3f2c064f9abd978cb08b4625f21751b4c24cc | |
parent | 94d048311da406d28fc207a21faa246416329171 (diff) |
*Try to fix a crash caused by adding player to wrong instance.
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index cdc9a87e1ae..a4f88581dca 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14782,6 +14782,12 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) instanceId = 0; } + // fix crash (because of if(Map *map = _FindMap(instanceId)) in MapInstanced::CreateInstance) + if(instanceId) + if(InstanceSave * save = GetInstanceSave(mapId)) + if(save->GetInstanceId() != instanceId) + instanceId = 0; + // NOW player must have valid map // load the player's map here if it's not already loaded Map *map = MapManager::Instance().CreateMap(mapId, this, instanceId); |