summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-30 19:24:02 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-30 19:24:02 +0000
commit0e7c825226666434ec32a8b3af04e19e1d9b0019 (patch)
tree5ea80ead239a2bda8a12c5a517680cb85b096127 /src/map/script.c
parent4e56c67d67a03bef92a61112aaca174fa14c8a4a (diff)
downloadhercules-0e7c825226666434ec32a8b3af04e19e1d9b0019.tar.gz
hercules-0e7c825226666434ec32a8b3af04e19e1d9b0019.tar.bz2
hercules-0e7c825226666434ec32a8b3af04e19e1d9b0019.tar.xz
hercules-0e7c825226666434ec32a8b3af04e19e1d9b0019.zip
* 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
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files changed, 6 insertions, 7 deletions
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) )
{