Sfoglia il codice sorgente

* '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://svn.code.sf.net/p/rathena/svn/trunk@14095 54d463be-8e91-2dee-dedb-b68131a5f0ec

Inkfish 15 anni fa
parent
commit
7b46d2c473
2 ha cambiato i file con 12 aggiunte e 5 eliminazioni
  1. 3 0
      Changelog-Trunk.txt
  2. 9 5
      src/map/npc.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
+09/10/24
+	* 'OnTouch' script shouldn't trigger when you are invisible.(same as warps) [Inkfish]
+	* Fixed character doesn't stop walking when walking into OnTouch area of an NPC who doesn't have an OnTouch label. [Inkfish]
 09/10/18
 09/10/18
 	* Removed the char_rename setting in favor of a PACKETVER define [ultramage]
 	* Removed the char_rename setting in favor of a PACKETVER define [ultramage]
 	* Inverted the way renames are counted: '0' now means 'no renames left' (the default)
 	* Inverted the way renames are counted: '0' now means 'no renames left' (the default)

+ 9 - 5
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)
 	if(sd->npc_id)
 		return 1;
 		return 1;
 
 
+	if (sd->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK))
+		return 0;
+
 	for(i=0;i<map[m].npc_num;i++)
 	for(i=0;i<map[m].npc_num;i++)
 	{
 	{
 		if (map[m].npc[i]->sc.option&OPTION_INVISIBLE) {
 		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) {
 	switch(map[m].npc[i]->subtype) {
 		case WARP:
 		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);
 			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;
 			break;
 		case SCRIPT:
 		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 )
 			if( npc_event(sd,name,0) > 0 )
 			{// failed to run OnTouch event, so just click the npc
 			{// 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]);
 				npc_click(sd,map[m].npc[i]);
 			}
 			}
-
-			pc_stop_walking(sd,1); //Make it stop walking!
 			break;
 			break;
 		}
 		}
 	}
 	}