From 49c9b9db4aab8ef96b96fc4f6042d4c615e5197d Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 21 Aug 2016 13:16:00 +1000 Subject: [PATCH] Send .frags via entcs --- qcsrc/common/ent_cs.qc | 4 ++++ qcsrc/common/ent_cs.qh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 1290a9356..41183d85b 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -38,6 +38,10 @@ PROP(true, clientcolors, \ { WriteByte(chan, this.clientcolors); }, \ { this.colormap = ReadByte(); }) \ + \ + PROP(true, frags, \ + { WriteShort(chan, this.frags); }, \ + { this.frags = ReadShort(); }) \ \ /**/ diff --git a/qcsrc/common/ent_cs.qh b/qcsrc/common/ent_cs.qh index 9981665e9..1dec53be6 100644 --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@ -58,10 +58,12 @@ REGISTER_NET_TEMP(CLIENT_ENTCS) /** * @param i zero indexed player */ + .int frags; bool entcs_IsSpectating(int i) { bool unconnected = !playerslots[i].gotscores; - return unconnected || stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR; + entity e = entcs_receiver(i); + return unconnected || ((e) ? e.frags : stof(getplayerkeyvalue(i, "frags"))) == FRAGS_SPECTATOR; } /** -- 2.39.2