diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | doc/script_commands.txt | 11 | ||||
-rw-r--r-- | src/map/script.c | 13 |
3 files changed, 18 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index fb671dc7e..a50e7f65c 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,6 +1,8 @@ Date Added 2011/05/30 + * Fixed script command 'warpguild' looking for an attached player even when it is not needed (bugreport:4941, since r2674, related r14840). [Ai4rei] + - Documented special map names recognized by the command. * 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 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index e0730cd3b..621438e4a 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4,7 +4,7 @@ //= A reference manual for the eAthena scripting language. //= Commands are sorted depending on their functionality. //===== Version =========================================== -//= 3.43.20110529 +//= 3.44.20110530 //========================================================= //= 1.0 - First release, filled will as much info as I could //= remember or figure out, most likely there are errors, @@ -177,6 +177,8 @@ //= 3.43.20110529 //= Updated 'npcshopitem', 'npcshopadditem' and 'npcshopdelitem' to support //= cashshops as well. [Ai4rei] +//= 3.44.20110530 +//= Documented special map names recognized by 'warpguild'. [Ai4rei] //========================================================= This document is a reference manual for all the scripting commands and functions @@ -3692,6 +3694,13 @@ warpchar "prontera",150,100,20000001; Warps a guild to specified map and coordinate given the guild id, which you can get with getcharid(2). You can also request another guild id given the member's name with getcharid(2,<player_name>). +You can use the following "map names" for special warping behavior: +Random: All party members are randomly warped in their current map (as if they + all used a fly wing) +SavePointAll: All party members are warped to their respective save point. +SavePoint: All party members are warped to the save point of the currently + attached player (will fail if there's no player attached). + Example: warpguild "prontera",x,y,Guild_ID; 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) ) { |