]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/notifications/all.qc
Fix broken notifications with bots
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / notifications / all.qc
index c8fb372d6bbbe74fb826fe67bcfa08f88b4d5412..6038e6df84d120a01c773489ca31bbe86e356ad1 100644 (file)
@@ -1,4 +1,5 @@
 #include "all.qh"
+
 #if defined(CSQC)
        #include <client/announcer.qh>
 #elif defined(MENUQC)
@@ -6,10 +7,9 @@
        #include <common/constants.qh>
        #include <common/net_linked.qh>
        #include <common/teams.qh>
-       #include <server/autocvars.qh>
-       #include <server/constants.qh>
-       #include <server/g_world.qh>
+       #include <server/command/getreplies.qh>
        #include <server/mutators/_mod.qh>
+       #include <server/world.qh>
 #endif
 
 // ================================================
@@ -79,6 +79,9 @@ string Notification_CheckArgs(
 
 bool Notification_ShouldSend(NOTIF broadcast, entity to_client, entity other_client)
 {
+       if(!IS_REAL_CLIENT(to_client))
+               return false;
+
        switch (broadcast)
        {
                case NOTIF_ONE:
@@ -1520,7 +1523,7 @@ void Send_Notification(
        MSG net_type, Notification net_name,
        ...count)
 {
-    if (broadcast != NOTIF_ALL && broadcast != NOTIF_ALL_EXCEPT && !IS_REAL_CLIENT(client)) return;
+    if (broadcast == NOTIF_ONE_ONLY && !IS_REAL_CLIENT(client)) return;
        entity notif = net_name;
        string parms = sprintf("%s, '%s', %s, %s",
                Get_Notif_BroadcastName(broadcast),