]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_edict.c
-Fixed an old qc bug that's already been existing in the original quake
[xonotic/darkplaces.git] / pr_edict.c
index 0482bcfda4a50aa740351103f08cc05bc13e3464..bbfd1e4d1950847e10b0befa27ba5deb661a47cd 100644 (file)
@@ -209,9 +209,16 @@ void ED_ClearEdict (edict_t *e)
        num = NUM_FOR_EDICT(e) - 1;
        if (num >= 0 && num < svs.maxclients)
        {
+               eval_t *val;
+               // set colormap and team on newly created player entity
                e->v->colormap = num + 1;
                e->v->team = (svs.clients[num].colors & 15) + 1;
+               // set netname/clientcolors back to client values so that
+               // DP_SV_CLIENTNAME and DPV_SV_CLIENTCOLORS will not immediately
+               // reset them
                e->v->netname = PR_SetString(svs.clients[num].name);
+               if ((val = GETEDICTFIELDVALUE(e, eval_clientcolors)))
+                       val->_float = svs.clients[num].colors;
        }
 }
 
@@ -976,7 +983,8 @@ qboolean ED_ParseEpair(edict_t *ent, ddef_t *key, const char *s)
                        Con_DPrintf("ED_ParseEpair: Can't find field %s\n", s);
                        return false;
                }
-               val->_int = G_INT(def->ofs);
+               //val->_int = G_INT(def->ofs); AK Please check this - seems to be an org. quake bug
+               val->_int = def->ofs;
                break;
 
        case ev_function: