From 73a2a21ee4ce9cd2eefc885288d84ab3ca68a0fc Mon Sep 17 00:00:00 2001 From: Tartalo Date: Sat, 26 Jun 2010 21:15:48 +0200 Subject: Fix possible crash --HG-- branch : trunk --- src/server/game/Entities/Player/Player.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5093ec518a6..4100df480fe 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16100,17 +16100,20 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) // Map could be changed before mapEntry = sMapStore.LookupEntry(mapId); // client without expansion support - if (mapEntry && GetSession()->Expansion() < mapEntry->Expansion()) + if (mapEntry) { - sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); - RelocateToHomebind(); - } + if (GetSession()->Expansion() < mapEntry->Expansion()) + { + sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); + RelocateToHomebind(); + } - // fix crash (because of if (Map *map = _FindMap(instanceId)) in MapInstanced::CreateInstance) - if (instanceId) - if (InstanceSave * save = GetInstanceSave(mapId, mapEntry->IsRaid())) - if (save->GetInstanceId() != instanceId) - instanceId = 0; + // fix crash (because of if (Map *map = _FindMap(instanceId)) in MapInstanced::CreateInstance) + if (instanceId) + if (InstanceSave * save = GetInstanceSave(mapId, mapEntry->IsRaid())) + if (save->GetInstanceId() != instanceId) + instanceId = 0; + } // NOW player must have valid map // load the player's map here if it's not already loaded -- cgit v1.2.3