]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'z411/notif-fix' into 'master'
authorMario <mario.mario@y7mail.com>
Thu, 3 Dec 2020 14:14:38 +0000 (14:14 +0000)
committerMario <mario.mario@y7mail.com>
Thu, 3 Dec 2020 14:14:38 +0000 (14:14 +0000)
Fix broken notifications with bots

See merge request xonotic/xonotic-data.pk3dir!860

.gitlab-ci.yml
qcsrc/common/notifications/all.qc

index 8c878258cd3172f5f9ce24f812e1e272731a17f9..987834296f7649d51126ad6b56d1c18618a7921b 100644 (file)
@@ -29,7 +29,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
     - make
-    - EXPECT=35117dbed178a88ab65576740023dc4b
+    - EXPECT=49e05085eef413931c74d7c82666b1f4
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index b2e278a18472c7ff498c3abd465d9ee375610bfc..6038e6df84d120a01c773489ca31bbe86e356ad1 100644 (file)
@@ -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),