]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Let announcer queue guess announcer length
authorz411 <z411@omaera.org>
Sun, 30 Oct 2022 20:17:52 +0000 (17:17 -0300)
committerz411 <z411@omaera.org>
Sun, 30 Oct 2022 20:17:52 +0000 (17:17 -0300)
qcsrc/common/notifications/all.inc
qcsrc/common/notifications/all.qc

index bd46f35d7aaeb3394c581fa8c2f9a71cbd9bf23d..5a73a17e4031fe3e2cf8c8060f60b9bb722e35e8 100644 (file)
 #define N_GNTLOFF 1
 #define N__ALWAYS 2
 
-#define ANNCE_DEFTIME 2
+// defaault time for announcer queue (time to wait before the next announcer is played)
+// -1 = bypass queue and play the announcer immediately
+// 0 = use the announcer sound length
+// >0 = use the specified time to wait
+#define ANNCE_DEFTIME 0
 
 #define MULTITEAM_ANNCE(prefix, defaultvalue, sound, channel, volume, position) \
     NOTIF_ADD_AUTOCVAR(ANNCE_##prefix, defaultvalue) \
index 685febf0fdfbdab915e8c516ca8baaef3e8502c0..c8bcb6a68df6c172b4c2812978dcc34be18ccf71 100644 (file)
@@ -1200,7 +1200,8 @@ void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time)
        if(queue_time == -1 || time > notif_queue_next_time) {
                // Run immediately
                Local_Notification_Queue_Run(net_type, notif);
-               notif_queue_next_time = time + queue_time;
+               if(queue_time >= 0)
+                       notif_queue_next_time = time + (queue_time == 0 ? soundlength(AnnouncerFilename(notif.nent_snd)) : queue_time);
        } else {
                // Put in queue
                if(notif_queue_length >= NOTIF_QUEUE_MAX) return;