From 1b7f0890b08afab332a2707ae09e88fe65e054c2 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sun, 21 Apr 2013 22:05:28 -0400 Subject: [PATCH] Fix a bunch of other things with new announcer code --- qcsrc/common/command/generic.qc | 6 +++-- qcsrc/common/notifications.qc | 45 +++++++++++++++++++-------------- qcsrc/common/notifications.qh | 2 +- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 6643387f8..3059916c6 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -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 diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 45587607e..a0f19746a 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -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 diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index b0963029a..a1dc0d942 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -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) \ -- 2.39.2