From 0e7c825226666434ec32a8b3af04e19e1d9b0019 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Mon, 30 May 2011 19:24:02 +0000 Subject: * Fixed script command 'warpguild' looking for an attached player even when it is not needed (bugreport:4941, since r2674, related r14840). - Documented special map names recognized by the command. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14841 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index bf2a173ac..0511a410b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4641,7 +4641,7 @@ BUILDIN_FUNC(warpparty) *------------------------------------------*/ BUILDIN_FUNC(warpguild) { - TBL_PC *sd; + TBL_PC *sd = NULL; TBL_PC *pl_sd; struct guild* g; struct s_mapiterator* iter; @@ -4652,21 +4652,20 @@ BUILDIN_FUNC(warpguild) int y = script_getnum(st,4); int gid = script_getnum(st,5); - sd=script_rid2sd(st); - if( sd == NULL ) - return 0; g = guild_search(gid); if( g == NULL ) 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 : 3; + if( type == 2 && ( sd = script_rid2sd(st) ) == NULL ) + {// "SavePoint" uses save point of the currently attached player + return 0; + } + iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { -- cgit v1.2.3-60-g2f50