viewing paste LP fix | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
static void skill_unitsetmapcell (struct skill_unit *src, int skill_num, int skill_lv, cell_t cell, bool flag)
{      
        int range = skill_get_unit_range(skill_num,skill_lv);
        int x,y;
       
        if(skill_num == SA_LANDPROTECTOR){
            for( y = src->bl.y - range; y <= src->bl.y + range; ++y )
                for( x = src->bl.x - range; x <= src->bl.x + range; ++x ){
                     //border doesn't have cell type just show it on client
                    if(y == (src->bl.y - range) || y == (src->bl.y + range) || x == (src->bl.x - range) || x == (src->bl.x + range))
                        clif_changemapcell(0,src->bl.m,x,y,(flag)?CELL_LANDPROTECTOR|CELL_WALKABLE:CELL_WALKABLE,AREA);
                    else
                        map_setcell(src->bl.m, x, y, cell, flag);  
                }        
        }      
        else
        for( y = src->bl.y - range; y <= src->bl.y + range; ++y )
                for( x = src->bl.x - range; x <= src->bl.x + range; ++x )
                        map_setcell(src->bl.m, x, y, cell, flag);
}
Viewed 387 times, submitted by lighta.