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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index d828832c6..f739159fb 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -165,6 +165,8 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data)
ud->walktimer = INVALID_TIMER;
if(sd) {
+ if( sd->touching_id )
+ npc_touchnext_areanpc(sd,false);
if(map_getcell(bl->m,x,y,CELL_CHKNPC)) {
npc_touch_areanpc(sd,bl->m,x,y);
if (bl->prev == NULL) //Script could have warped char, abort remaining of the function.
@@ -172,9 +174,6 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data)
} else
sd->areanpc_id=0;
- if( sd->ontouch.npc_id )
- npc_touchnext_areanpc(sd,false);
-
if (sd->state.gmaster_flag &&
(battle_config.guild_aura&((agit_flag || agit2_flag)?2:1)) &&
(battle_config.guild_aura&(map_flag_gvg2(bl->m)?8:4))
@@ -518,6 +517,8 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
ud->walktimer = INVALID_TIMER;
if(sd) {
+ if( sd->touching_id )
+ npc_touchnext_areanpc(sd,false);
if(map_getcell(bl->m,bl->x,bl->y,CELL_CHKNPC)) {
npc_touch_areanpc(sd,bl->m,bl->x,bl->y);
if (bl->prev == NULL) //Script could have warped char, abort remaining of the function.
@@ -525,9 +526,6 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
} else
sd->areanpc_id=0;
- if( sd->ontouch.npc_id )
- npc_touchnext_areanpc(sd,false);
-
if( sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 0 )
{ // Check if pet needs to be teleported. [Skotlex]
int flag = 0;
@@ -1816,7 +1814,7 @@ int unit_remove_map_(struct block_list *bl, int clrtype, const char* file, int l
guild_reply_reqalliance(sd,sd->guild_alliance_account,0);
if(sd->menuskill_id)
sd->menuskill_id = sd->menuskill_val = 0;
- if( sd->ontouch.npc_id )
+ if( sd->touching_id )
npc_touchnext_areanpc(sd,true);
sd->npc_shopid = 0;