From 24cd2d1aac086a3a58f68f0eb82467ba2e17ec14 Mon Sep 17 00:00:00 2001 From: z411 Date: Mon, 30 Jan 2023 08:05:05 -0300 Subject: [PATCH] Wait until relative announcing merge --- qcsrc/common/notifications/all.inc | 40 +++++++++++++++--------------- qcsrc/server/world.qc | 14 ++++++++--- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 85fdcd514..0fe37893b 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -106,12 +106,12 @@ #define ANNCE_LENGTH 0 #define ANNCE_DEFTIME 2 -#define MULTITEAM_ANNCE(prefix, defaultvalue, sound, channel, volume, position, queuetime) \ +#define MULTITEAM_ANNCE(prefix, defaultvalue, sound, channel, volume, position) \ NOTIF_ADD_AUTOCVAR(ANNCE_##prefix, defaultvalue) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_1, prefix##_RED, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_1)), channel, volume, position, queuetime) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_2, prefix##_BLUE, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_2)), channel, volume, position, queuetime) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_3, prefix##_YELLOW, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), channel, volume, position, queuetime) \ - MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_4, prefix##_PINK, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), channel, volume, position, queuetime) + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_1, prefix##_RED, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_1)), channel, volume, position) \ + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_2, prefix##_BLUE, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_2)), channel, volume, position) \ + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_3, prefix##_YELLOW, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), channel, volume, position) \ + MSG_ANNCE_NOTIF_TEAM(NUM_TEAM_4, prefix##_PINK, prefix, defaultvalue, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), channel, volume, position) // MSG_ANNCE_NOTIFICATIONS MSG_ANNCE_NOTIF(ACHIEVEMENT_AIRSHOT, N_GNTLOFF, "airshot", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) @@ -210,25 +210,25 @@ MSG_ANNCE_NOTIF(VOTE_CALL, N__ALWAYS, "votecall", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) MSG_ANNCE_NOTIF(VOTE_FAIL, N__ALWAYS, "votefail", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) - MSG_ANNCE_NOTIF(LEAD_GAINED, N__ALWAYS, "leadgained", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(LEAD_LOST, N__ALWAYS, "leadlost", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(LEAD_TIED, N__ALWAYS, "leadtied", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) + MSG_ANNCE_NOTIF(LEAD_GAINED, N__ALWAYS, "leadgained", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(LEAD_LOST, N__ALWAYS, "leadlost", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(LEAD_TIED, N__ALWAYS, "leadtied", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) - MSG_ANNCE_NOTIF(TEAM_SCORES_TEAM, N__ALWAYS, "scores_team", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(TEAM_SCORES_ENEMY, N__ALWAYS, "scores_enemy", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MULTITEAM_ANNCE(TEAM_SCORES, N__ALWAYS, "scores_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) + MSG_ANNCE_NOTIF(TEAM_SCORES_TEAM, N__ALWAYS, "scores_team", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(TEAM_SCORES_ENEMY, N__ALWAYS, "scores_enemy", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MULTITEAM_ANNCE(TEAM_SCORES, N__ALWAYS, "scores_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) - MSG_ANNCE_NOTIF(TEAM_LEADS_TEAM, N__ALWAYS, "leads_team", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(TEAM_LEADS_ENEMY, N__ALWAYS, "leads_enemy", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(TEAM_LEADS_TIED, N__ALWAYS, "teamstied", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MULTITEAM_ANNCE(TEAM_LEADS, N__ALWAYS, "leads_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) + MSG_ANNCE_NOTIF(TEAM_LEADS_TEAM, N__ALWAYS, "leads_team", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(TEAM_LEADS_ENEMY, N__ALWAYS, "leads_enemy", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(TEAM_LEADS_TIED, N__ALWAYS, "teamstied", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MULTITEAM_ANNCE(TEAM_LEADS, N__ALWAYS, "leads_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) - MULTITEAM_ANNCE(TEAM_WINS, N__ALWAYS, "wins_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) + MULTITEAM_ANNCE(TEAM_WINS, N__ALWAYS, "wins_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) - MULTITEAM_ANNCE(ROUND_TEAM_WIN, N__ALWAYS, "round_win_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(ROUND_OVER, N__ALWAYS, "round_over", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(ROUND_TIED, N__ALWAYS, "round_tied", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) - MSG_ANNCE_NOTIF(ALONE, N__ALWAYS, "alone", CH_INFO, VOL_BASEVOICE, ATTEN_NONE, ANNCE_DEFTIME) + MULTITEAM_ANNCE(ROUND_TEAM_WIN, N__ALWAYS, "round_win_%s", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(ROUND_OVER, N__ALWAYS, "round_over", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(ROUND_TIED, N__ALWAYS, "round_tied", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(ALONE, N__ALWAYS, "alone", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) #undef N___NEVER #undef N_GNTLOFF diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index d6cb8f271..3984b912a 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1442,7 +1442,8 @@ void AnnounceNewLeader() 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)); + // TODO : This needs relative announcing to be merged! + //Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(WinningConditionHelper_winnerteam, ANNCE_TEAM_LEADS)); } else { if (WinningConditionHelper_equality) { @@ -1459,7 +1460,11 @@ void AnnounceNewLeader() int team_scores; int fragsleft_last; -#define AnnounceScores(tm) team_scores = tm; +void AnnounceScores(int tm) +{ + team_scores = tm; +} + float WinningCondition_Scores(float limit, float leadlimit) { // TODO make everything use THIS winning condition (except LMS) @@ -1536,10 +1541,11 @@ float WinningCondition_Scores(float limit, float leadlimit) else Send_Notification(NOTIF_ONE_ONLY, it, MSG_ANNCE, ANNCE_TEAM_SCORES_ENEMY); }); - Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(team_scores, ANNCE_TEAM_SCORES)); + // TODO : This needs relative announcing to be merged! + //Send_Notification(NOTIF_ALL_SPEC, NULL, MSG_ANNCE, APP_TEAM_NUM(team_scores, ANNCE_TEAM_SCORES)); } team_scores = 0; - } else if(MUTATOR_CALLHOOK(Scores_AnnounceLeads) && Score_NewLeader()) { + } else if(MUTATOR_CALLHOOK(Scores_AnnounceLeads) && Score_NewLeader()) AnnounceNewLeader(); bool fraglimit_reached = (limit && WinningConditionHelper_topscore >= limit); -- 2.39.2