From 829e61b7f26edfc02bfee5cefa0c9915c27a0622 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sun, 14 Apr 2013 23:28:51 -0400 Subject: [PATCH] More announcer stuff, plus fix #1476 --- qcsrc/common/notifications.qc | 10 +++++++++- qcsrc/common/notifications.qh | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index bc06af1b9..fbed3e589 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -426,7 +426,7 @@ void Create_Notification_Entity( if(msg_is_multi) { // Set MSG_MULTI string/float counts - if((infoname == NO_MSG) && (centername == NO_MSG)) + if((anncename == NO_MSG) && (infoname == NO_MSG) && (centername == NO_MSG)) { print(sprintf( strcat( @@ -440,6 +440,9 @@ void Create_Notification_Entity( } else { + // announcements don't actually need any arguments, so lets not even count them. + if(anncename != NO_MSG) { notif.nent_msgannce = msg_annce_notifs[anncename - 1]; } + float infoname_stringcount = 0, infoname_floatcount = 0; float centername_stringcount = 0, centername_floatcount = 0; @@ -465,8 +468,10 @@ void Create_Notification_Entity( else if(typeid == MSG_ANNCE) { // Set MSG_ANNCE information and handle precaching + #ifdef CSQC if(snd != "") { + precache_sound(sprintf("announcer/%s/%s", autocvar_cl_announcer, snd)); notif.nent_channel = channel; notif.nent_snd = strzone(snd); notif.nent_vol = vol; @@ -484,6 +489,9 @@ void Create_Notification_Entity( )); notif_error = TRUE; } + #else + notif.nent_enabled = FALSE; + #endif } else { diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index c525bdd0c..84d41f8e2 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -346,8 +346,8 @@ void Send_Notification_WOVA( MSG_INFO_NOTIF(1, INFO_QUIT_KICK_SPECTATING, 0, 0, "", "", "", _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment.\n"), "") \ MSG_INFO_NOTIF(1, INFO_QUIT_SPECTATE, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating\n"), "") \ MSG_INFO_NOTIF(1, INFO_RACE_ABANDONED, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race\n"), "") \ - MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED, 1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1", "race_newfail", _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s\n"), "") \ - MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED, 1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1", "race_newfail", _("^BG%s^BG couldn't break the %s%s^BG place record of %s%s %s\n"), "") \ + MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED, 1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1", "race_newfail", _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s\n"), "") \ + MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED, 1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1", "race_newfail", _("^BG%s^BG couldn't break the %s%s^BG place record of %s%s %s\n"), "") \ MSG_INFO_NOTIF(1, INFO_RACE_FINISHED, 1, 0, "s1", "", "", _("^BG%s^BG has finished the race\n"), "") \ MSG_INFO_NOTIF(1, INFO_RACE_NEW_BROKEN, 2, 3, "s1 s2 race_col f1ord race_col f2race_time race_diff", "s1 s2", "race_newrankyellow", _("^BG%s^BG broke %s^BG's %s%s^BG place record with %s%s %s\n"), "") \ MSG_INFO_NOTIF(1, INFO_RACE_NEW_IMPROVED, 1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1", "race_newtime", _("^BG%s^BG improved their %s%s^BG place record with %s%s %s\n"), "") \ @@ -779,6 +779,7 @@ string arg_slot[NOTIF_MAX_ARGS]; ARG_CASE(ARG_CS, "f1time", process_time(2, f1)) \ ARG_CASE(ARG_CS_SV, "f1race_time", mmssss(f1)) \ ARG_CASE(ARG_CS_SV, "f2race_time", mmssss(f2)) \ + ARG_CASE(ARG_CS_SV, "f3race_time", mmssss(f3)) \ ARG_CASE(ARG_CS_SV, "race_col", CCR(((f1 == 1) ? "^F1" : "^F2"))) \ ARG_CASE(ARG_CS_SV, "race_diff", ((f2 > f3) ? sprintf(CCR("^1[+%s]"), mmssss(f2 - f3)) : sprintf(CCR("^2[-%s]"), mmssss(f3 - f2)))) \ ARG_CASE(ARG_CS, "kh_teams", notif_arg_kh_teams(f1, f2, f3, f4)) \ -- 2.39.2