summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-16 14:42:16 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-16 14:42:16 +0000
commit5e053d4db7ef162f13246219a5e0b12046a7c7f8 (patch)
treed6a2f311c63cb3fafae5033679d7c7f8c9ab6cc9 /src/map/unit.c
parente07326b0aa71a74cacd425e30745bb01a60b153f (diff)
downloadhercules-5e053d4db7ef162f13246219a5e0b12046a7c7f8.tar.gz
hercules-5e053d4db7ef162f13246219a5e0b12046a7c7f8.tar.bz2
hercules-5e053d4db7ef162f13246219a5e0b12046a7c7f8.tar.xz
hercules-5e053d4db7ef162f13246219a5e0b12046a7c7f8.zip
* [Improved]:
- Cleaned up Custom Mob Script Callback codes. Looks much better now :B. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7202 54d463be-8e91-2dee-dedb-b68131a5f0ec
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;
}