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 --- Changelog-Trunk.txt | 3 +++ src/map/script.c | 13 ++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index c4620ed9b..fb671dc7e 100644 --- a/Changelog-Trunk.txt +++ b/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] 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