]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use a regular FOREACH_CLIENT macro for access to the client in the loop when sending...
authorMario <mario@smbclan.net>
Sun, 16 Jul 2017 18:03:12 +0000 (04:03 +1000)
committerMario <mario@smbclan.net>
Sun, 16 Jul 2017 18:03:12 +0000 (04:03 +1000)
qcsrc/server/race.qc

index df343754943a6275b5109fbd11f50a2653620b72..5947403397556152ceae52353e9aed05a9938b06 100644 (file)
@@ -456,17 +456,21 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
 
                if(IS_REAL_CLIENT(e))
                {
-                       msg_entity = e;
                        if(g_race_qualifying)
                        {
-                               WRITESPECTATABLE_MSG_ONE(e, {
-                                       WriteHeader(MSG_ONE, TE_CSQC_RACE);
-                                       WriteByte(MSG_ONE, RACE_NET_CHECKPOINT_HIT_QUALIFYING);
-                                       WriteByte(MSG_ONE, race_CheckpointNetworkID(cp)); // checkpoint the player now is at
-                                       WriteInt24_t(MSG_ONE, t); // time to that intermediate
-                                       WriteInt24_t(MSG_ONE, recordtime); // previously best time
-                                       WriteInt24_t(MSG_ONE, ((tvalid) ? it.race_checkpoint_record[cp] : 0)); // previously best time
-                                       WriteString(MSG_ONE, recordholder); // record holder
+                               FOREACH_CLIENT(IS_REAL_CLIENT(it),
+                               {
+                                       if(it == e || (IS_SPEC(it) && it.enemy == e))
+                                       {
+                                               msg_entity = it;
+                                               WriteHeader(MSG_ONE, TE_CSQC_RACE);
+                                               WriteByte(MSG_ONE, RACE_NET_CHECKPOINT_HIT_QUALIFYING);
+                                               WriteByte(MSG_ONE, race_CheckpointNetworkID(cp)); // checkpoint the player now is at
+                                               WriteInt24_t(MSG_ONE, t); // time to that intermediate
+                                               WriteInt24_t(MSG_ONE, recordtime); // previously best time
+                                               WriteInt24_t(MSG_ONE, ((tvalid) ? it.race_checkpoint_record[cp] : 0)); // previously best time
+                                               WriteString(MSG_ONE, recordholder); // record holder
+                                       }
                                });
                        }
                }