From 4e56c67d67a03bef92a61112aaca174fa14c8a4a Mon Sep 17 00:00:00 2001 From: ai4rei Date: Mon, 30 May 2011 19:00:43 +0000 Subject: * 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14840 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index 44bac8c9d..bf2a173ac 100644 --- a/src/map/script.c +++ b/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 ) -- cgit v1.2.3-70-g09d2