From 280cc7f8d6a7123918b08858ee3a62d81f64c073 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 22 Aug 2016 00:41:04 +1000 Subject: [PATCH] Intrusify notifications --- qcsrc/common/notifications/all.qc | 5 +++-- qcsrc/common/notifications/all.qh | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index acd570d0b..dd5f3a164 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1532,8 +1532,8 @@ void Kill_Notification( net_notif.nent_net_name = ORDINAL(net_cpid); Net_LinkEntity(net_notif, false, autocvar_notification_lifetime_runtime, Net_Write_Notification); - FOREACH_ENTITY_CLASS( - "net_notification", + IL_EACH( + g_notifications, (it.owner.nent_type == net_type || net_type == MSG_Null) && (it.owner.nent_cpid == net_cpid || net_cpid == CPID_Null), { it.nent_net_name = -1; @@ -1682,6 +1682,7 @@ void Send_Notification( else { entity net_notif = new_pure(net_notification); + IL_PUSH(g_notifications, net_notif); net_notif.owner = notif; net_notif.nent_broadcast = broadcast; net_notif.nent_client = client; diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index 271592594..ccdcc690a 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -225,6 +225,11 @@ string prev_soundfile; float prev_soundtime; #endif +#ifdef SVQC +IntrusiveList g_notifications; +STATIC_INIT(g_notifications) { g_notifications = IL_NEW(); } +#endif + #ifdef SVQC ENUMCLASS(NOTIF) /** send to one client and their spectators */ -- 2.39.2