diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 13 |
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 ) |