diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 45396e32df..2e741aad15 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -9392,6 +9392,7 @@ QMARK_PURPLE - Purple Marker Adds the first waiting player from the chat room of the given NPC to an existing battleground group. The player will also be warped to the default spawn point of the battle group or to the specified coordinates and on the given . +Note: The map need the mapflag MF_BATTLEGROUND otherwise the player is removed from the Battleground team. --------------------------------------- @@ -9437,6 +9438,7 @@ Returns battle group ID on success. Returns 0 on failure. Adds an attached player or if specified to an existing battleground group. The player will also be warped to the default spawn point of the battle group or to the specified coordinates and on the given . +Note: The map need the mapflag MF_BATTLEGROUND otherwise the player is removed from the Battleground team. Returns true on success. Returns false on failure. @@ -9566,8 +9568,8 @@ Example: Retrieves data related to given Battle Group. Type can be one of the following: 0 - Amount of players currently belonging to the group. - 1 - Store GID of players in in a temporary global array $@arenamembers - and returns amount of players currently belonging to the group. + 1 - Store GID of players in in a temporary global array $@arenamembers, + stores and also returns the amount of players currently belonging to the group in $@arenamemberscount. --------------------------------------- diff --git a/src/map/script.cpp b/src/map/script.cpp index 2cb2354cdf..79148a1aa4 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -19970,6 +19970,11 @@ BUILDIN_FUNC(waitingroom2bg_single) x = bg->cemetery.x; y = bg->cemetery.y; } + if (!map_getmapflag(map_mapindex2mapid(mapindex), MF_BATTLEGROUND)) { + ShowWarning("buildin_waitingroom2bg_single: Map %s requires the mapflag MF_BATTLEGROUND.\n", mapindex_id2name(mapindex)); + script_pushint(st, false); + return SCRIPT_CMD_FAILURE; + } nd = npc_name2id(script_getstr(st,6)); @@ -20055,6 +20060,11 @@ BUILDIN_FUNC(bg_join) { script_pushint(st, false); return SCRIPT_CMD_FAILURE; } + if (!map_getmapflag(map_mapindex2mapid(mapindex), MF_BATTLEGROUND)) { + ShowWarning("buildin_bg_join: Map %s requires the mapflag MF_BATTLEGROUND.\n", mapindex_id2name(mapindex)); + script_pushint(st, false); + return SCRIPT_CMD_FAILURE; + } if (bg_team_join(bg_id, sd, false) && pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) == SETPOS_OK) {