Bugfix: wrong team rotation in spectate mode

master
Zughy 2021-02-17 22:08:20 +01:00
parent 3d11a4bcb4
commit a3953ea4b5
2 changed files with 2 additions and 3 deletions

View File

@ -230,7 +230,6 @@ There are also some other functions which might turn useful. They are:
Default is 0 and these are mostly hardcoded in arena_lib already, so it's advised to not touch it and to use callbacks. The only exception is in case of manual elimination (ie. in a murder minigame, so reason = 1).
Executioner can be passed to tell who removed the player. By default, this happens when someone uses `/arenakick` and `/forceend`, so that these commands can't be abused without consequences for the admin.
* `arena_lib.send_message_in_arena(arena, channel, msg, <teamID>, <except_teamID>)`: sends a message to all the players/spectators in that specific arena, according to what `channel` is: `"players"`, `"spectators"` or `"both"`. If `teamID` is specified, it'll be only sent to the players inside that very team. On the contrary, if `except_teamID` is `true`, it'll be sent to every player BUT the ones in the specified team. These last two fields are pointless if `channel` is equal to `"spectators"`
* `arena_lib.teleport_in_arena(sender, mod, arena_name)`: teleports the sender into the arena if at least one spawner has been set
* `arena_lib.is_player_spectating(sp_name)`: returns whether a player is spectating a match, as a boolean
* `arena_lib.is_player_spectated(p_name)`: returns whether a player is being spectated
* `arena_lib.is_arena_in_edit_mode(arena_name)`: returns whether the arena is in edit mode or not, as a boolean

View File

@ -181,12 +181,12 @@ function arena_lib.find_and_spectate_player(sp_name, change_team)
end
-- eventuale cambio squadra sul quale eseguire il calcolo
if change_team and prev_spectated then
if change_team then
arena.spectators_amount_per_team[team_ID] = arena.spectators_amount_per_team[team_ID] - 1
local active_teams = arena_lib.get_active_teams(arena)
if team_ID >= #active_teams then
if team_ID >= active_teams[#active_teams] then
team_ID = active_teams[1]
else
for i = team_ID + 1, #arena.teams do