From 7da9ee0b5c0aad9425441bcddeeadb745aa4c0d5 Mon Sep 17 00:00:00 2001 From: Inkfish Date: Sun, 25 Oct 2009 09:38:33 +0000 Subject: * Implemented the official version of 'OnTouch' named as 'OnTouch_'.(it can be defined in script_athena.conf) * Adapted 'map_foreachinarea' to 'map_forsomeinarea' so that it allows you to specify the number of bl you wanna operate on. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14097 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/unit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/map/unit.c') diff --git a/src/map/unit.c b/src/map/unit.c index 0ba48b32b..c75600180 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -171,6 +171,10 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data) return 0; } 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)) @@ -520,6 +524,10 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool return 0; } 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; @@ -1804,6 +1812,8 @@ 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 ) + npc_touchnext_areanpc(sd,true); sd->npc_shopid = 0; sd->adopt_invite = 0; -- cgit v1.2.3-60-g2f50