]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/ent_cs.qh
Merge branch 'master' into terencehill/hud_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / ent_cs.qh
index 9981665e90f5d5003ddf7aa73a1b572ae81b5ce4..65cdd83d3a71f4f5df325a8e90b727d936cb1300 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;
        }
 
        /**
@@ -107,7 +109,7 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
        string entcs_GetName(int i)
        {
                entity e = entcs_receiver(i);
-               return e ? ColorTranslateRGB(e.netname) : ColorTranslateRGB(getplayerkeyvalue(i, "name"));
+               return ColorTranslateRGB(e ? e.netname : getplayerkeyvalue(i, "name"));
        }
 
     /**