]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Send .frags via entcs
authorMario <mario@smbclan.net>
Sun, 21 Aug 2016 03:16:00 +0000 (13:16 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Aug 2016 03:16:00 +0000 (13:16 +1000)
qcsrc/common/ent_cs.qc
qcsrc/common/ent_cs.qh

index 1290a9356477a0704c3e15893c94eb1b8a369518..41183d85b21d5c505b4becc57bba4f1df396971c 100644 (file)
     PROP(true, clientcolors, \
        { WriteByte(chan, this.clientcolors); }, \
        { this.colormap = ReadByte(); }) \
+    \
+    PROP(true, frags, \
+       { WriteShort(chan, this.frags); }, \
+       { this.frags = ReadShort(); }) \
     \
        /**/
 
index 9981665e90f5d5003ddf7aa73a1b572ae81b5ce4..1dec53be65e2434a33779b62d1190f5df0f621fa 100644 (file)
@@ -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;
        }
 
        /**