bool queuePlayer(entity this)
{
- if(IsQueueNeeded(this) && !SpectatorWantsJoin(this))
+ if(IS_QUEUE_NEEDED(this) && !SpectatorWantsJoin(this))
{
if(autocvar_g_balance_teams)
TeamBalance_JoinBestTeam(this);
return true;
}
-bool IsQueueNeeded(entity ignore)
-{
- return (teamplay && autocvar_g_balance_teams_queue && !autocvar_g_campaign && AVAILABLE_TEAMS == 2 && TeamBalance_AreEqual(ignore, true));
-}
-
entity SpectatorWantsJoin(entity this)
{
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if (team_index != -1)
{
- if (!IS_BOT_CLIENT(player) && IsQueueNeeded(player) && !SpectatorWantsJoin(player))
+ if (!IS_BOT_CLIENT(player) && IS_QUEUE_NEEDED(player) && !SpectatorWantsJoin(player))
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_WANTS_TEAM), player.netname);
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_JOIN_PREVENT_QUEUE);
return;
}
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MOVETOSPEC_REMOVE, playername(remove_player.netname, remove_player.team, true), remove_timeleft);
--remove_timeleft;
this.nextthink = time + 1;
}
remove_countdown = new_pure(remove_countdown);
setthink(remove_countdown, Remove_Countdown);
remove_countdown.nextthink = time;
+
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MOVETOSPEC_REMOVE, playername(remove_player.netname, remove_player.team, true), remove_timeleft);
}
}
else
.int team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
+#define IS_QUEUE_NEEDED(ignore) \
+ (teamplay && autocvar_g_balance_teams_queue && !autocvar_g_campaign && AVAILABLE_TEAMS == 2 \
+ && TeamBalance_AreEqual(ignore, true))
+
// ========================== Global teams API ================================
void Team_InitTeams();
TEAM_CHANGE_SPECTATOR = 4 ///< Player is joining spectators. //TODO: Remove?
};
-bool IsQueueNeeded(entity ignore);
entity SpectatorWantsJoin(entity this);
/// \brief Sets the team of the player.