viewing paste Unknown #5787 | 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
Index: src/map/script.c
===================================================================
--- src/map/script.c    (revision 17307)
+++ src/map/script.c    (working copy)
@@ -15372,17 +15372,13 @@
 
    bl = map_id2bl(script_getnum(st,2));
    if( bl == NULL )
-   {
        script_pushint(st, 0);
-   }
-   else if( script_hasdata(st,4) )
-   {
+
+   if( script_hasdata(st,4) ) {
        int x = script_getnum(st,3);
        int y = script_getnum(st,4);
-       script_pushint(st, unit_walktoxy(bl,x,y,0));// We'll use harder calculations.
-   }
-   else
-   {
+       script_pushint(st,add_timer(gettick()+50, unit_delay_walktoxy_timer, bl->id, (x<<16)|(y&0xFFFF)));
+   } else {
        int map_id = script_getnum(st,3);
        script_pushint(st, unit_walktobl(bl,map_id2bl(map_id),65025,1));
    }
Index: src/map/unit.c
===================================================================
--- src/map/unit.c  (revision 17307)
+++ src/map/unit.c  (working copy)
@@ -298,7 +298,7 @@
    return 0;
 }
 
-static int unit_delay_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data)
+int unit_delay_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data)
 {
    struct block_list *bl = map_id2bl(id);
 
Index: src/map/unit.h
===================================================================
--- src/map/unit.h  (revision 17307)
+++ src/map/unit.h  (working copy)
@@ -86,9 +86,10 @@
 int unit_can_move(struct block_list *bl);
 int unit_is_walking(struct block_list *bl);
 int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type);
+int unit_delay_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data);
 
 int unit_escape(struct block_list *bl, struct block_list *target, short dist);
-// ˆÊ’u‚Ì‹­§ˆÚ“®(‚«”ò‚΂µ‚È‚Ç)
+// Instant unit changes
 int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
 int unit_warp(struct block_list *bl, short map, short x, short y, clr_type type);
 int unit_setdir(struct block_list *bl,unsigned char dir);
Viewed 678 times, submitted by Guest.