From: z411 Date: Sat, 12 Nov 2022 04:41:51 +0000 (-0300) Subject: Fixed announcer queue bug where queue time wouldn't get calculated properly with... X-Git-Tag: xonotic-v0.8.6~237^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=76ed95f4d94adb6b2412cb149497ca4527187a1b;p=xonotic%2Fxonotic-data.pk3dir.git Fixed announcer queue bug where queue time wouldn't get calculated properly with soundlength --- diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index 557a1b00c..58910887e 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -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;