[10113] Some cleanups in Instance loading code.

* Remove reduncent chekc and args for MapInstanced::CreateInstance(const uint32 mapId, Player * player)
* Rename for avoid name duplication raw InstanceMap creating to MapInstanced::CreateInstanceMap
* Move lookup code of player/group bounde instance save to Player::GetBoundInstanceSaveForSelfOrGroup
This commit is contained in:
VladimirMangos 2010-06-27 19:26:35 +04:00
parent 3eb2d2910e
commit 6f4481a591
6 changed files with 50 additions and 45 deletions

View file

@ -120,7 +120,8 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
//if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
Map *m = _createBaseMap(id);
if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((MapInstanced*)m)->CreateInstance(id, (Player*)obj);
if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable())
m = ((MapInstanced*)m)->CreateInstance((Player*)obj);
return m;
}