瀏覽代碼

* Fixed script command 'warpparty' looking for an attached player even when it is not needed (bugreport:4359, since r14311, related r2674 and r5592).
- This also resolves an issue, where the command fails when the attached player is on a map that has noreturn or nowarpto mapflags set.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14840 54d463be-8e91-2dee-dedb-b68131a5f0ec

ai4rei 14 年之前
父節點
當前提交
ce70d39dbc
共有 2 個文件被更改,包括 9 次插入7 次删除
  1. 3 0
      Changelog-Trunk.txt
  2. 6 7
      src/map/script.c

+ 3 - 0
Changelog-Trunk.txt

@@ -1,5 +1,8 @@
 Date	Added
 
+2011/05/30
+	* Fixed script command 'warpparty' looking for an attached player even when it is not needed (bugreport:4359, since r14311, related r2674 and r5592). [Ai4rei]
+	- This also resolves an issue, where the command fails when the attached player is on a map that has noreturn or nowarpto mapflags set.
 2011/05/29
 	* Fixed pets' speed would not get updated to normal, after they finished running to their owner (bugreport:1304). [Ai4rei]
 	* Fixed NULL pointer in status_change_timer (SC_BERSERK), when the HP subtraction causes the HP drop below 100, but does not exceed remaining HP (bugreport:1150, related r8705, r11786 and r12061). [Ai4rei]

+ 6 - 7
src/map/script.c

@@ -4554,7 +4554,7 @@ BUILDIN_FUNC(warpchar)
  *------------------------------------------*/
 BUILDIN_FUNC(warpparty)
 {
-	TBL_PC *sd;
+	TBL_PC *sd = NULL;
 	TBL_PC *pl_sd;
 	struct party_data* p;
 	int type;
@@ -4569,22 +4569,21 @@ BUILDIN_FUNC(warpparty)
 	if ( script_hasdata(st,6) )
 		str2 = script_getstr(st,6);
 
-	sd=script_rid2sd(st);
-	if( sd == NULL )
-		return 0;
 	p = party_search(p_id);
 	if(!p)
 		return 0;
 	
-	if(map[sd->bl.m].flag.noreturn || map[sd->bl.m].flag.nowarpto)
-		return 0;
-	
 	type = ( strcmp(str,"Random")==0 ) ? 0
 	     : ( strcmp(str,"SavePointAll")==0 ) ? 1
 		 : ( strcmp(str,"SavePoint")==0 ) ? 2
 		 : ( strcmp(str,"Leader")==0 ) ? 3
 		 : 4;
 
+	if( type == 2 && ( sd = script_rid2sd(st) ) == NULL )
+	{// "SavePoint" uses save point of the currently attached player
+		return 0;
+	}
+
 	for (i = 0; i < MAX_PARTY; i++)
 	{
 		if( !(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id )