summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 5ec465d43..249b1db71 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -27,6 +27,7 @@
#include "party.h"
#include "intif.h"
#include "chrif.h"
+#include "script.h"
static int dirx[8]={0,-1,-1,-1,0,1,1,1};
static int diry[8]={1,1,0,-1,-1,-1,0,1};
@@ -244,6 +245,8 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
} else { //Stopped walking. Update to_x and to_y to current location [Skotlex]
ud->to_x = bl->x;
ud->to_y = bl->y;
+ if(md && md->nd) // Tell the script engine we've finished walking (for AI pathfinding)
+ mob_script_callback(md, NULL, CALLBACK_WALKACK);
}
return 0;
}
@@ -530,6 +533,12 @@ int unit_warp(struct block_list *bl,int m,short x,short y,int type)
map_addblock(bl);
clif_spawn(bl);
skill_unit_move(bl,gettick(),1);
+
+ if(bl->type == BL_MOB){
+ TBL_MOB *md = (TBL_MOB *)bl;
+ if(md->nd) // Tell the script engine we've warped
+ mob_script_callback(md, NULL, CALLBACK_WARPACK);
+ }
return 0;
}