From 76d1081505d1ee0d33c12cd22b0bc98c63897b8f Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 17 Jul 2017 04:03:12 +1000 Subject: [PATCH] Use a regular FOREACH_CLIENT macro for access to the client in the loop when sending personal best time --- qcsrc/server/race.qc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index df3437549..594740339 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -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 + } }); } } -- 2.39.2