From 9ba40902f3631d47d842cb431d53a76c8ae71a07 Mon Sep 17 00:00:00 2001 From: z411 Date: Thu, 5 Jan 2023 16:15:47 +0000 Subject: [PATCH] Fixed notification bug in 3-4 team CTF Added pickup notification for 3-4 team CTF --- notifications.cfg | 8 ++++++++ qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc | 9 +++------ qcsrc/common/notifications/all.inc | 6 ++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/notifications.cfg b/notifications.cfg index 5a31635fb..8eff36f2e 100644 --- a/notifications.cfg +++ b/notifications.cfg @@ -374,6 +374,10 @@ seta notification_CENTER_CTF_PASS_SENT "1" "0 = off, 1 = centerprint" seta notification_CENTER_CTF_PICKUP_ENEMY "1" "0 = off, 1 = centerprint" seta notification_CENTER_CTF_PICKUP_ENEMY_NEUTRAL "1" "0 = off, 1 = centerprint" seta notification_CENTER_CTF_PICKUP_ENEMY_NEUTRAL_VERBOSE "1" "0 = off, 1 = centerprint" +seta notification_CENTER_CTF_PICKUP_ENEMY_OTHER_NEUTRAL "1" "0 = off, 1 = centerprint" +seta notification_CENTER_CTF_PICKUP_ENEMY_OTHER "1" "0 = off, 1 = centerprint" +seta notification_CENTER_CTF_PICKUP_ENEMY_OTHER_VERBOSE_NEUTRAL "1" "0 = off, 1 = centerprint" +seta notification_CENTER_CTF_PICKUP_ENEMY_OTHER_VERBOSE "1" "0 = off, 1 = centerprint" seta notification_CENTER_CTF_PICKUP_ENEMY_TEAM "1" "0 = off, 1 = centerprint" seta notification_CENTER_CTF_PICKUP_ENEMY_TEAM_VERBOSE "1" "0 = off, 1 = centerprint" seta notification_CENTER_CTF_PICKUP_ENEMY_VERBOSE "1" "0 = off, 1 = centerprint" @@ -713,6 +717,10 @@ seta notification_CHOICE_CTF_PICKUP_ENEMY "1" "Choice for this notification 0 = seta notification_CHOICE_CTF_PICKUP_ENEMY_ALLOWED "2" "Allow choice for this notification 0 = off, 1 = only in warmup mode, 2 = always" seta notification_CHOICE_CTF_PICKUP_ENEMY_NEUTRAL "1" "Choice for this notification 0 = off, 1 = default message, 2 = verbose message" seta notification_CHOICE_CTF_PICKUP_ENEMY_NEUTRAL_ALLOWED "2" "Allow choice for this notification 0 = off, 1 = only in warmup mode, 2 = always" +seta notification_CHOICE_CTF_PICKUP_ENEMY_OTHER_NEUTRAL "1" "Choice for this notification 0 = off, 1 = default message, 2 = verbose message" +seta notification_CHOICE_CTF_PICKUP_ENEMY_OTHER_NEUTRAL_ALLOWED "2" "Allow choice for this notification 0 = off, 1 = only in warmup mode, 2 = always" +seta notification_CHOICE_CTF_PICKUP_ENEMY_OTHER "1" "Choice for this notification 0 = off, 1 = default message, 2 = verbose message" +seta notification_CHOICE_CTF_PICKUP_ENEMY_OTHER_ALLOWED "2" "Allow choice for this notification 0 = off, 1 = only in warmup mode, 2 = always" seta notification_CHOICE_CTF_PICKUP_ENEMY_TEAM "1" "Choice for this notification 0 = off, 1 = default message, 2 = verbose message" seta notification_CHOICE_CTF_PICKUP_ENEMY_TEAM_ALLOWED "2" "Allow choice for this notification 0 = off, 1 = only in warmup mode, 2 = always" seta notification_CHOICE_CTF_PICKUP_TEAM_NEUTRAL "1" "Choice for this notification 0 = off, 1 = default message, 2 = verbose message" diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index a1e1c5990..b83b1da7c 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -732,12 +732,9 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) if(flag.team) FOREACH_CLIENT(IS_PLAYER(it) && it != player, { if(CTF_SAMETEAM(flag, it)) - { - if(SAME_TEAM(player, it)) - Send_Notification(NOTIF_ONE, it, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname); - else - Send_Notification(NOTIF_ONE, it, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), player.netname); - } + Send_Notification(NOTIF_ONE, it, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), player.netname); + else if(DIFF_TEAM(player, it)) + Send_Notification(NOTIF_ONE, it, MSG_CHOICE, APP_NUM(flag.team, CHOICE_CTF_PICKUP_ENEMY_OTHER), Team_ColorCode(player.team), player.netname); }); _sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE); diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 360a3439a..26071cd1a 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -567,6 +567,10 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_CENTER_NOTIF(CTF_PICKUP_ENEMY_NEUTRAL_VERBOSE, N_ENABLE, 2, 0, "s1 s2 s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy (^BG%s%s)^BG got the flag! Retrieve it!"), "") MSG_CENTER_NOTIF(CTF_PICKUP_ENEMY_TEAM, N_ENABLE, 1, 0, "s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy^BG got their flag! Retrieve it!"), "") MSG_CENTER_NOTIF(CTF_PICKUP_ENEMY_TEAM_VERBOSE, N_ENABLE, 2, 0, "s1 s2 s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy (^BG%s%s)^BG got their flag! Retrieve it!"), "") + MULTITEAM_CENTER(CTF_PICKUP_ENEMY_OTHER, N_ENABLE, 1, 0, "s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy^BG got the ^TC^TT^BG flag! Retrieve it!"), "", FLAG) + MULTITEAM_CENTER(CTF_PICKUP_ENEMY_OTHER_VERBOSE, N_ENABLE, 2, 0, "s1 s2 s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy (^BG%s%s)^BG got the ^TC^TT^BG flag! Retrieve it!"), "", FLAG) + MSG_CENTER_NOTIF(CTF_PICKUP_ENEMY_OTHER_NEUTRAL, N_ENABLE, 1, 0, "s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy^BG got the flag! Retrieve it!"), "") + MSG_CENTER_NOTIF(CTF_PICKUP_ENEMY_OTHER_VERBOSE_NEUTRAL, N_ENABLE, 2, 0, "s1 s2 s1", CPID_CTF_LOWPRIO, "0 0", _("^BGThe %senemy (^BG%s%s)^BG got the flag! Retrieve it!"), "") MULTITEAM_CENTER(CTF_PICKUP_TEAM, N_ENABLE, 1, 0, "s1", CPID_CTF_LOWPRIO, "0 0", _("^BGYour %steam mate^BG got the ^TC^TT^BG flag! Protect them!"), "", FLAG) MULTITEAM_CENTER(CTF_PICKUP_TEAM_VERBOSE, N_ENABLE, 2, 0, "s1 s2 s1", CPID_CTF_LOWPRIO, "0 0", _("^BGYour %steam mate (^BG%s%s)^BG got the ^TC^TT^BG flag! Protect them!"), "", FLAG) MSG_CENTER_NOTIF(CTF_PICKUP_TEAM_NEUTRAL, N_ENABLE, 1, 0, "s1", CPID_CTF_LOWPRIO, "0 0", _("^BGYour %steam mate^BG got the flag! Protect them!"), "") @@ -989,10 +993,12 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MULTITEAM_CHOICE(CTF_CAPTURE_TIME, N_VERBOSE, A_ALWAYS, MSG_INFO, INFO_CTF_CAPTURE, INFO_CTF_CAPTURE_TIME) MULTITEAM_CHOICE(CTF_CAPTURE_UNBROKEN, N_VERBOSE, A_ALWAYS, MSG_INFO, INFO_CTF_CAPTURE, INFO_CTF_CAPTURE_UNBROKEN) MULTITEAM_CHOICE(CTF_PICKUP_TEAM, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_TEAM, CENTER_CTF_PICKUP_TEAM_VERBOSE) + MULTITEAM_CHOICE(CTF_PICKUP_ENEMY_OTHER, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY_OTHER, CENTER_CTF_PICKUP_ENEMY_OTHER_VERBOSE) MSG_CHOICE_NOTIF(CTF_PICKUP_TEAM_NEUTRAL, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_TEAM_NEUTRAL, CENTER_CTF_PICKUP_TEAM_VERBOSE_NEUTRAL) MSG_CHOICE_NOTIF(CTF_PICKUP_ENEMY, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY, CENTER_CTF_PICKUP_ENEMY_VERBOSE) MSG_CHOICE_NOTIF(CTF_PICKUP_ENEMY_NEUTRAL, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY_NEUTRAL, CENTER_CTF_PICKUP_ENEMY_NEUTRAL_VERBOSE) MSG_CHOICE_NOTIF(CTF_PICKUP_ENEMY_TEAM, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY_TEAM, CENTER_CTF_PICKUP_ENEMY_TEAM_VERBOSE) + MSG_CHOICE_NOTIF(CTF_PICKUP_ENEMY_OTHER_NEUTRAL, N__NORMAL, A_ALWAYS, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY_OTHER_NEUTRAL, CENTER_CTF_PICKUP_ENEMY_OTHER_VERBOSE_NEUTRAL) MSG_CHOICE_NOTIF(FRAG, N__NORMAL, A_WARMUP, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, CENTER_DEATH_MURDER_FRAG_VERBOSE) MSG_CHOICE_NOTIF(FRAGGED, N__NORMAL, A_WARMUP, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) MSG_CHOICE_NOTIF(FRAG_FIRE, N__NORMAL, A_WARMUP, MSG_CENTER, CENTER_DEATH_MURDER_FRAG_FIRE, CENTER_DEATH_MURDER_FRAG_FIRE_VERBOSE) -- 2.39.2