aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-08 19:05:44 -0500
committermegamage <none@none>2009-08-08 19:05:44 -0500
commit2f83f6a79c21cef2dadeaa6ba19d36e163f49f57 (patch)
tree8ac3f2c064f9abd978cb08b4625f21751b4c24cc /src
parent94d048311da406d28fc207a21faa246416329171 (diff)
*Try to fix a crash caused by adding player to wrong instance.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp6
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);