viewing paste warmer, cell overlap | 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
static int skill_cell_overlap(struct block_list *bl, va_list ap)
{
    int skillid;
    int *alive;
    struct skill_unit *unit;
    struct block_list *src;
 
    skillid = va_arg(ap,int);
    alive = va_arg(ap,int *);
    src = va_arg(ap,struct block_list *);
    unit = (struct skill_unit *)bl;
 
    if (unit == NULL || unit->group == NULL || (*alive) == 0)
        return 0;
 
    switch (skillid)
    {
        /*..other declaration that we don't care here..*/
        case SA_VOLCANO:
        case SA_DELUGE:
        case SA_VIOLENTGALE:
                        if(unit->group->skill_id == SO_WARMER){ //can't be put on top of warmer
                            (*alive) = 0;
                            return 1;
                        }
// The official implementation makes them fail to appear when casted on top of ANYTHING
// but I wonder if they didn't actually meant to fail when casted on top of each other?
// hence, I leave the alternate implementation here, commented. [Skotlex]
            if (unit->range <= 0)
            {
                (*alive) = 0;
                return 1;
            }
/*
            switch (unit->group->skill_id)
            {   //These cannot override each other.
                case SA_VOLCANO:
                case SA_DELUGE:
                case SA_VIOLENTGALE:
                    (*alive) = 0;
                    return 1;
            }
*/
            break;
        /*..other declaration that we don't care here..*/
               case SO_WARMER: //client display issue
                        if (unit->group->skill_id == SA_LANDPROTECTOR) //can't be put on top of LP
            {   //can't be place on top of LP
                (*alive) = 0;
                return 1;
            }
            break;
    }
 
    if (unit->group->skill_id == SA_LANDPROTECTOR &&
        !(skill_get_inf2(skillid)&(INF2_SONG_DANCE|INF2_TRAP)))
    {   //It deletes everything except songs/dances/traps
        (*alive) = 0;
        return 1;
    }
 
    return 0;
}
Viewed 1002 times, submitted by lighta.