]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed notification bug in 3-4 team CTF
authorz411 <z411@omaera.org>
Thu, 5 Jan 2023 16:15:47 +0000 (16:15 +0000)
committerterencehill <piuntn@gmail.com>
Thu, 5 Jan 2023 16:15:47 +0000 (16:15 +0000)
Added pickup notification for 3-4 team CTF

notifications.cfg
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/notifications/all.inc

index 5a31635fbbc3edd5716615df6089a49ed16977a9..8eff36f2e063c69b7f33c63e0248a039582d788b 100644 (file)
@@ -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"
index a1e1c59900ba4ac5ac435e8dcdc73d431f0bc57a..b83b1da7ce908dc5fe0c0a2fb5561cd735106828 100644 (file)
@@ -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);
index 360a3439a61478ac7d649a0c2e26ad247239c37f..26071cd1ac7f96afc9ce07c65672ac9af330a089 100644 (file)
@@ -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)