viewing paste Unknown #17843 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
int map_addflooritem_area(struct block_list* bl, int m, int x, int y, int nameid, int amount)
{
        struct item item_tmp;
        int count, range, i;
        short mx, my;
 
        memset(&item_tmp, 0, sizeof(item_tmp));
        item_tmp.nameid = nameid;
        item_tmp.identify = 1;
 
        if( bl != NULL ) m = bl->m;
 
        count = 0;
        range = (int)sqrt(amount) +2;
        for( i = 0; i < amount; i++ )
        {
                if( bl != NULL )
                        map->search_freecell(bl, 0, &mx, &my, range, range, 0);
                else
                {
                        mx = x; my = y;
                        map->search_freecell(NULL, m, &mx, &my, range, range, 1);
                }
 
                count += (map->addflooritem(&item_tmp, 1, m, mx, my, 0, 0, 0, 4) != 0) ? 1 : 0;
        }
 
        return count;
}
Viewed 701 times, submitted by milk.