summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-26 12:01:19 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-26 12:01:19 +0000
commit476222257ace810a1e69d552c969f36c4687f4d9 (patch)
tree4366787ac16e9f9d952b9cc1dee2c4e45d20e9f2 /src/map/unit.c
parent07dee1fd6c710b78fc826679966dbb6c0c1a8d44 (diff)
downloadhercules-476222257ace810a1e69d552c969f36c4687f4d9.tar.gz
hercules-476222257ace810a1e69d552c969f36c4687f4d9.tar.bz2
hercules-476222257ace810a1e69d552c969f36c4687f4d9.tar.xz
hercules-476222257ace810a1e69d552c969f36c4687f4d9.zip
* NPC event code cleanups.
- removed the 'OnMyMobDead' dead code. It's never supported though documented. - removed the 'feature' that events only trigger when the player is in the OnTouch area IF it's specified. It's never documented and breaks official scripts. - some cleanups and bug fixes to OnTouch_. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14173 54d463be-8e91-2dee-dedb-b68131a5f0ec
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;