viewing paste Unknown #6070 | Diff

Posted on the | Last edited on
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
Index: src/map/unit.c
===================================================================
--- src/map/unit.c  (revision 17344)
+++ src/map/unit.c  (working copy)
@@ -137,19 +137,21 @@
 }
 
 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 {
-       struct block_list *bl = map_id2bl(id);
-       int *mast_tid = unit_get_masterteleport_timer(bl);
        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)){
+           if(msd && !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 );
            }
Viewed 1084 times, submitted by lighta.