]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a bunch of other things with new announcer code
authorSamual Lenks <samual@xonotic.org>
Mon, 22 Apr 2013 02:05:28 +0000 (22:05 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 22 Apr 2013 02:05:28 +0000 (22:05 -0400)
qcsrc/common/command/generic.qc
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh

index 6643387f8896069d615ecb4a15624b2c665aaa23..3059916c61ba4445c9b0da907b187d36a817adc4 100644 (file)
@@ -436,13 +436,15 @@ void GenericCommand_restartnotifs(float request)
                        print(sprintf(
                                strcat(
                                        "Restart_Notifications(): Restarting %d notifications... ",
-                                       "Counts: MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d\n"
+                                       "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d\n"
                                ),
                                (
+                                       NOTIF_ANNCE_COUNT +
                                        NOTIF_INFO_COUNT +
                                        NOTIF_CENTER_COUNT +
                                        NOTIF_MULTI_COUNT
-                               ), 
+                               ),
+                               NOTIF_ANNCE_COUNT,
                                NOTIF_INFO_COUNT,
                                NOTIF_CENTER_COUNT,
                                NOTIF_MULTI_COUNT
index 45587607e6d911938817c8f1305b232b7dcdd5a5..a0f19746a1e7abc2dd4e1e1a006ea28b59ee4fed 100644 (file)
@@ -469,26 +469,33 @@ void Create_Notification_Entity(
        {
                // Set MSG_ANNCE information and handle precaching
                #ifdef CSQC
-               if(snd != "")
+               if not(GENTLE && (var_cvar == 1))
                {
-                       precache_sound(sprintf("announcer/%s/%s.wav", autocvar_cl_announcer, snd));
-                       notif.nent_channel = channel;
-                       notif.nent_snd = strzone(snd);
-                       notif.nent_vol = vol;
-                       notif.nent_position = position;
-               }
-               else
-               {
-                       print(sprintf(
-                               strcat(
-                                       "^1NOTIFICATION WITH NO SOUND: ",
-                                       "^7net_type = %s, net_name = %s.\n"
-                               ),
-                               typestring,
-                               namestring
-                       ));
-                       notif_error = TRUE;
+                       if(snd != "")
+                       {
+                               if(notif.nent_enabled)
+                               {
+                                       precache_sound(sprintf("announcer/%s/%s.wav", autocvar_cl_announcer, snd));
+                                       notif.nent_channel = channel;
+                                       notif.nent_snd = strzone(snd);
+                                       notif.nent_vol = vol;
+                                       notif.nent_position = position;
+                               }
+                       }
+                       else
+                       {
+                               print(sprintf(
+                                       strcat(
+                                               "^1NOTIFICATION WITH NO SOUND: ",
+                                               "^7net_type = %s, net_name = %s.\n"
+                                       ),
+                                       typestring,
+                                       namestring
+                               ));
+                               notif_error = TRUE;
+                       }
                }
+               else { notif.nent_enabled = FALSE; }
                #else
                notif.nent_enabled = FALSE;
                #endif
@@ -1347,7 +1354,7 @@ void Kill_Notification(
                "Kill_Notification(%d, '%s', %s, %d);\n",
                broadcast,
                client.netname,
-               Get_Notif_TypeName(net_type),
+               (net_type ? Get_Notif_TypeName(net_type) : "0"),
                net_name
        ));
        #endif
index b0963029a281fbd76d39c2fee41568bb6c9b7797..a1dc0d94263e368b2c411311f605c891e3dae570 100644 (file)
@@ -191,7 +191,7 @@ void Send_Notification_WOVA(
 */
 
 #define MSG_ANNCE_NOTIFICATIONS \
-       MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_1,           CH_INFO, "1minutesremain",    VOL_BASEVOICE, ATTN_NONE) \
+       MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_1,           CH_INFO, "1minuteremains",    VOL_BASEVOICE, ATTN_NONE) \
        MSG_ANNCE_NOTIF(2, ANNCE_REMAINING_MIN_5,           CH_INFO, "5minutesremain",    VOL_BASEVOICE, ATTN_NONE) \
        MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_1,          CH_INFO, "1fragleft",         VOL_BASEVOICE, ATTN_NONE) \
        MSG_ANNCE_NOTIF(1, ANNCE_REMAINING_FRAG_2,          CH_INFO, "2fragsleft",        VOL_BASEVOICE, ATTN_NONE) \