Beispiel #1
0
Map*
MapManager::_createBaseMap(uint32 id)
{
    Map *m = _findMap(id);

    if( m == NULL )
    {
        Guard guard(*this);

        const MapEntry* entry = sMapStore.LookupEntry(id);
        if (entry && entry->Instanceable())
        {
            m = new MapInstanced(id, i_gridCleanUpDelay);
        }
        else if (entry)
        {
            m = new Map(id, i_gridCleanUpDelay, 0, 0);
        }
        else
        {
            assert(false);
        }
        i_maps[id] = m;
    }

    assert(m != NULL);
    return m;
}
Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
{
    Map *map = _findMap(mapid);
    if(!map)
        return NULL;

    if(!map->Instanceable())
        return instanceId == 0 ? map : NULL;

    return ((MapInstanced*)map)->FindMap(instanceId);
}
Beispiel #3
0
Map* MapManager::_createBaseMap(uint32 id)
{
    Map* m = _findMap(id);

    if (m == NULL)
    {
        Guard guard(*this);

        const MapEntry* entry = sMapStore.LookupEntry(id);
        if (entry && entry->Instanceable())
            m = new MapInstanced(id, i_gridCleanUpDelay);
        else
            m = new Map(id, i_gridCleanUpDelay, 0, DIFFICULTY_NORMAL);
        i_maps[id] = m;
    }

    ASSERT(m != NULL);
    return m;
}
Beispiel #4
0
Map* MapManager::_createBaseMap(uint32 id)
{
    Map *m = _findMap(id);

    if (m == NULL)
    {
        ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);

        const MapEntry* entry = sMapStore.LookupEntry(id);
        if (entry && entry->Instanceable())
        {
            m = new MapInstanced(id, i_gridCleanUpDelay);
        }
        else
        {
            m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY);
        }
        i_maps[id] = m;
    }

    ASSERT(m != NULL);
    return m;
}
Beispiel #5
0
Map*
MapManager::_GetBaseMap(uint32 id)
{
    Map *m = _findMap(id);

    if( m == NULL )
    {
        Guard guard(*this);

        const MapEntry* entry = sMapStore.LookupEntry(id);
        if (entry && ((entry->map_type == MAP_INSTANCE) || (entry->map_type == MAP_RAID)))
        {
            m = new MapInstanced(id, i_gridCleanUpDelay, 0);
        }
        else
        {
            m = new Map(id, i_gridCleanUpDelay, 0);
        }
        i_maps[id] = m;
    }

    assert(m != NULL);
    return m;
}