summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-26 03:37:02 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-26 03:37:02 +0000
commit0b27e84e040963c35dbbf1ff1440fbc2b0e5142d (patch)
tree8084faab5fe5dd1217333456eaac72a51727bbd9 /src/map/unit.c
parentbf2d3808586a129afaf764fcd6a40a539969fe87 (diff)
downloadhercules-0b27e84e040963c35dbbf1ff1440fbc2b0e5142d.tar.gz
hercules-0b27e84e040963c35dbbf1ff1440fbc2b0e5142d.tar.bz2
hercules-0b27e84e040963c35dbbf1ff1440fbc2b0e5142d.tar.xz
hercules-0b27e84e040963c35dbbf1ff1440fbc2b0e5142d.zip
- Walk/move functions will abort now when an area npc script triggers and moves the character out of the map.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5750 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index fc6c5c578..fe62c5da4 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -193,9 +193,11 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
ud->walktimer = -1;
if(sd) {
- if(map_getcell(bl->m,x,y,CELL_CHKNPC))
+ if(map_getcell(bl->m,x,y,CELL_CHKNPC)) {
npc_touch_areanpc(sd,bl->m,x,y);
- else
+ if (bl->prev == NULL) //Script could have warped char, abort remaining of the function.
+ return 0;
+ } else
sd->areanpc_id=0;
if (sd->state.gmaster_flag)
{ //Guild Aura: Likely needs to be recoded, this method seems inefficient.
@@ -343,9 +345,11 @@ int unit_movepos(struct block_list *bl,int dst_x,int dst_y, int easy, int checkp
ud->walktimer = -1;
if(sd) {
- if(map_getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
+ if(map_getcell(bl->m,bl->x,bl->y,CELL_CHKNPC)) {
npc_touch_areanpc(sd,bl->m,bl->x,bl->y);
- else
+ if (bl->prev == NULL) //Script could have warped char, abort remaining of the function.
+ return 0;
+ } else
sd->areanpc_id=0;
if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0)
{ //Check if pet needs to be teleported. [Skotlex]