]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed announcer queue bug where queue time wouldn't get calculated properly with...
authorz411 <z411@omaera.org>
Sat, 12 Nov 2022 04:41:51 +0000 (01:41 -0300)
committerz411 <z411@omaera.org>
Sat, 12 Nov 2022 04:58:42 +0000 (01:58 -0300)
qcsrc/common/notifications/all.qc

index 557a1b00cabf3aa0577c8a4b5b37f8e878fef96a..58910887e914a87c70393d5e0e043d6403495acb 100644 (file)
@@ -1194,11 +1194,14 @@ void Local_Notification_Queue_Run(MSG net_type, entity notif)
 
 void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time)
 {      
+       // Guess length if required
+       if(queue_time == 0)
+               queue_time = soundlength(AnnouncerFilename(notif.nent_snd));
+
        if(queue_time == -1 || time > notif_queue_next_time) {
                // Run immediately
                Local_Notification_Queue_Run(net_type, notif);
-               if(queue_time >= 0)
-                       notif_queue_next_time = time + (queue_time == 0 ? soundlength(AnnouncerFilename(notif.nent_snd)) : queue_time);
+               notif_queue_next_time = time + queue_time;
        } else {
                // Put in queue
                if(notif_queue_length >= NOTIF_QUEUE_MAX) return;