]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Intrusify notifications
authorMario <mario@smbclan.net>
Sun, 21 Aug 2016 14:41:04 +0000 (00:41 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Aug 2016 14:41:04 +0000 (00:41 +1000)
qcsrc/common/notifications/all.qc
qcsrc/common/notifications/all.qh

index acd570d0b67aeb7318267717b08ca924e1b7c949..dd5f3a164b58502f1b9bdacab31c4f1789145bbf 100644 (file)
@@ -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;
index 2715925944b6d16ae1701c4a3f0b5ba70db7c815..ccdcc690a8148cbc5308221823587225311af3c8 100644 (file)
@@ -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 */