From: Mario Date: Sun, 21 Aug 2016 03:16:00 +0000 (+1000) Subject: Send .frags via entcs X-Git-Tag: xonotic-v0.8.2~687^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=49c9b9db4aab8ef96b96fc4f6042d4c615e5197d;p=xonotic%2Fxonotic-data.pk3dir.git Send .frags via entcs --- 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; } /**