mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Clean up very some confusing MapManager functions (create/find map/base map).
This commit is contained in:
@@ -95,9 +95,9 @@ void MapManager::checkAndCorrectGridStatesArray()
|
||||
++i_GridStateErrorCount;
|
||||
}
|
||||
|
||||
Map* MapManager::_createBaseMap(uint32 id)
|
||||
Map* MapManager::CreateBaseMap(uint32 id)
|
||||
{
|
||||
Map* m = _findMap(id);
|
||||
Map* m = FindBaseMap(id);
|
||||
|
||||
if (m == NULL)
|
||||
{
|
||||
@@ -119,21 +119,19 @@ Map* MapManager::_createBaseMap(uint32 id)
|
||||
return m;
|
||||
}
|
||||
|
||||
Map* MapManager::CreateMap(uint32 id, const WorldObject* obj, uint32 /*instanceId*/)
|
||||
Map* MapManager::CreateMap(uint32 id, Player* player)
|
||||
{
|
||||
ASSERT(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);
|
||||
Map* m = CreateBaseMap(id);
|
||||
|
||||
if (m && obj->GetTypeId() == TYPEID_PLAYER && m->Instanceable())
|
||||
m = ((MapInstanced*)m)->CreateInstanceForPlayer(id, (Player*)obj);
|
||||
if (m && m->Instanceable())
|
||||
m = ((MapInstanced*)m)->CreateInstanceForPlayer(id, player);
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
|
||||
{
|
||||
Map* map = _findMap(mapid);
|
||||
Map* map = FindBaseMap(mapid);
|
||||
if (!map)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user