Fix possible crash

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-06-26 21:15:48 +02:00
parent 037857c2ce
commit 73a2a21ee4
+12 -9
View File
@@ -16100,17 +16100,20 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder)
// Map could be changed before // Map could be changed before
mapEntry = sMapStore.LookupEntry(mapId); mapEntry = sMapStore.LookupEntry(mapId);
// client without expansion support // 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); if (GetSession()->Expansion() < mapEntry->Expansion())
RelocateToHomebind(); {
} 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) // fix crash (because of if (Map *map = _FindMap(instanceId)) in MapInstanced::CreateInstance)
if (instanceId) if (instanceId)
if (InstanceSave * save = GetInstanceSave(mapId, mapEntry->IsRaid())) if (InstanceSave * save = GetInstanceSave(mapId, mapEntry->IsRaid()))
if (save->GetInstanceId() != instanceId) if (save->GetInstanceId() != instanceId)
instanceId = 0; instanceId = 0;
}
// NOW player must have valid map // NOW player must have valid map
// load the player's map here if it's not already loaded // load the player's map here if it's not already loaded