summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-10-24 03:03:30 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-10-24 03:03:30 +0000
commitfc47bdd30c4d195c34277636cbeab1b77d88c350 (patch)
tree337759e8fabe6f0e54d733c1051a3f93af3dfbab /src/map/npc.c
parent7a1be872fda99c67b4c160bba4316780434e17b8 (diff)
downloadhercules-fc47bdd30c4d195c34277636cbeab1b77d88c350.tar.gz
hercules-fc47bdd30c4d195c34277636cbeab1b77d88c350.tar.bz2
hercules-fc47bdd30c4d195c34277636cbeab1b77d88c350.tar.xz
hercules-fc47bdd30c4d195c34277636cbeab1b77d88c350.zip
* 'OnTouch' script shouldn't trigger when you are invisible.(same as warps)
* Fixed character doesn't stop walking when walking into OnTouch area of an NPC who doesn't have an OnTouch label. (bugreport:2700) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14095 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 3380f2ace..9447478f2 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -776,6 +776,9 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
if(sd->npc_id)
return 1;
+ if (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK))
+ return 0;
+
for(i=0;i<map[m].npc_num;i++)
{
if (map[m].npc[i]->sc.option&OPTION_INVISIBLE) {
@@ -807,9 +810,6 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
}
switch(map[m].npc[i]->subtype) {
case WARP:
- // hidden chars cannot use warps -- is it the same for scripts too?
- if (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK))
- break;
pc_setpos(sd,map[m].npc[i]->u.warp.mapindex,map[m].npc[i]->u.warp.x,map[m].npc[i]->u.warp.y,0);
break;
case SCRIPT:
@@ -824,10 +824,14 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
if( npc_event(sd,name,0) > 0 )
{// failed to run OnTouch event, so just click the npc
+ struct unit_data *ud = unit_bl2ud(&sd->bl);
+ if( ud && ud->walkpath.path_pos < ud->walkpath.path_len )
+ { // Since walktimer always == -1 at this time, we stop walking manually. [Inkfish]
+ clif_fixpos(&sd->bl);
+ ud->walkpath.path_pos = ud->walkpath.path_len;
+ }
npc_click(sd,map[m].npc[i]);
}
-
- pc_stop_walking(sd,1); //Make it stop walking!
break;
}
}