viewing paste Unknown #6077 | 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
int unit_teleport_timer(int tid, unsigned int tick, int id, intptr_t data){
    struct block_list *bl = map_id2bl(id);
    int *mast_tid = unit_get_masterteleport_timer(bl);
 
    if(tid == INVALID_TIMER)
        return 0;
    else if(*mast_tid && *mast_tid != tid)
        return 0;
    else {
        TBL_PC *msd = unit_get_master(bl);
        switch(data){
        case BL_HOM:
        case BL_ELEM:
        case BL_PET :
        case BL_MER :
            if(msd && *mast_tid != INVALID_TIMER && !check_distance_bl(&msd->bl, bl, MAX_MER_DISTANCE)){
                *mast_tid = INVALID_TIMER;
                unit_warp(bl, msd->bl.id, msd->bl.x, msd->bl.y, CLR_TELEPORT );
            }
            break;
        }
    }
    return 0;
}
Viewed 1292 times, submitted by lighta.