From: z411 Date: Sat, 12 Nov 2022 04:39:45 +0000 (-0300) Subject: Simplify announcer queue code X-Git-Tag: xonotic-v0.8.6~237^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8986f3650549d3b642a5a91b71dbaed718c25714;p=xonotic%2Fxonotic-data.pk3dir.git Simplify announcer queue code --- diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index 8e524c216..557a1b00c 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1214,21 +1214,17 @@ void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time) void Local_Notification_Queue_Process() { - if(!notif_queue_length) + if(!notif_queue_length || notif_queue_time[0] > time) return; - int j; - if(notif_queue_time[0] <= time) { - Local_Notification_Queue_Run(notif_queue_type[0], notif_queue_entity[0]); - - // Shift queue to the left - for (j = 0; j < notif_queue_length - 1; j++) { - notif_queue_type[j] = notif_queue_type[j+1]; - notif_queue_entity[j] = notif_queue_entity[j+1]; - notif_queue_time[j] = notif_queue_time[j+1]; - } - - --notif_queue_length; + Local_Notification_Queue_Run(notif_queue_type[0], notif_queue_entity[0]); + + // Shift queue to the left + --notif_queue_length; + for (int j = 0; j < notif_queue_length; j++) { + notif_queue_type[j] = notif_queue_type[j+1]; + notif_queue_entity[j] = notif_queue_entity[j+1]; + notif_queue_time[j] = notif_queue_time[j+1]; } }