summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-30 19:00:43 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-30 19:00:43 +0000
commit4e56c67d67a03bef92a61112aaca174fa14c8a4a (patch)
tree59a43e2b05e369d637dd908fe6e7bb368246f4f6 /src/map
parent02898a2a1693400a9e19c384dbcb27f5d6867bd6 (diff)
downloadhercules-4e56c67d67a03bef92a61112aaca174fa14c8a4a.tar.gz
hercules-4e56c67d67a03bef92a61112aaca174fa14c8a4a.tar.bz2
hercules-4e56c67d67a03bef92a61112aaca174fa14c8a4a.tar.xz
hercules-4e56c67d67a03bef92a61112aaca174fa14c8a4a.zip
* 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
Diffstat (limited to 'src/map')
-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 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 )