View Single Post
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 12-28-2010 , 01:45   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1003

Brad Maybe to change this
PHP Code:
map_getIdx(text[])
{
    new 
map[MAX_MAPNAME_LEN 1];
    new 
mapIdx;
    new 
nominationMap[32];
    
    for (new 
prefixIdx 0prefixIdx g_mapPrefixCnt; ++prefixIdx)
    {
        
formatex(mapsizeof(map)-1"%s%s"g_mapPrefix[prefixIdx], text);

        for (
mapIdx 0mapIdx g_nominationMapCnt; ++mapIdx)
        {
            
ArrayGetString(g_nominationMapmapIdxnominationMapsizeof(nominationMap)-1);
            
            if (
equal(mapnominationMap))
            {
                return 
mapIdx;
            }
        }
    }
    return -
1;

to
PHP Code:
map_getIdx(text[])
{
    new 
map[MAX_MAPNAME_LEN 1];
    new 
mapIdx;
    new 
nominationMap[32];
    
    
strtolower(text)
    
    for (new 
prefixIdx 0prefixIdx g_mapPrefixCnt; ++prefixIdx)
    {
        
formatex(mapsizeof(map)-1"%s%s"g_mapPrefix[prefixIdx], text);

        
TrieGetCell(g_Trie_nominationMapmapmapIdx);
        if (
mapIdx) return mapIdx    
    
}
    return -
1;

?

This way is much better than with array
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-