From b9f78517543c59e2b1feb1ff086cd9b41f876178 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Thu, 15 Apr 2021 02:46:10 +0200 Subject: [PATCH] Merge branch 'master' into LegendaryGuard/bai_mod --- qcsrc/server/world.qc | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 4dbf79199..6f9591e5b 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1429,6 +1429,51 @@ void ClearWinners() FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; }); } +//z411 +void AnnounceNewLeader() +{ + if(teamplay) { + if (WinningConditionHelper_equality) + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TEAM_LEADS_TIED); + else + FOREACH_CLIENT(IS_PLAYER(it), { + if(it.team == WinningConditionHelper_winnerteam) + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_LEADS_TEAM); + else + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_LEADS_ENEMY); + }); + Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(WinningConditionHelper_winnerteam, ANNCE_TEAM_LEADS)); + } else { + if (WinningConditionHelper_equality) + { + Send_Notification(NOTIF_ONE, WinningConditionHelper_equality_one, MSG_ANNCE, ANNCE_LEAD_TIED); + Send_Notification(NOTIF_ONE, WinningConditionHelper_equality_two, MSG_ANNCE, ANNCE_LEAD_TIED); + } + else + { + Send_Notification(NOTIF_ONE, WinningConditionHelper_winner, MSG_ANNCE, ANNCE_LEAD_GAINED); + Send_Notification(NOTIF_ONE, WinningConditionHelper_second, MSG_ANNCE, ANNCE_LEAD_LOST); + } + } +} + +//z411 +void AnnounceScores(float tm) +{ + WinningConditionHelper(NULL); + if (Score_NewLeader()) { + AnnounceNewLeader(); + } else { + FOREACH_CLIENT(IS_PLAYER(it), { + if(it.team == tm) + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_SCORES_TEAM); + else + Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_SCORES_ENEMY); + }); + Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(tm, ANNCE_TEAM_SCORES)); + } +} + int fragsleft_last; float WinningCondition_Scores(float limit, float leadlimit) { -- 2.39.2