]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/ent_cs.qh
Send .frags via entcs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / ent_cs.qh
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;
        }
 
        /**