X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=pr_edict.c;h=0e8fbc6db55d805ba03db37a742a44e3ca2c1a59;hb=a845e9f59600c6443cfca0517d9c30ee9f0904b9;hp=1cb4bf9cd1564f5547245b4c14599196c33d99d4;hpb=49efc53510842f29eccbc160e1aa56c17e575468;p=xonotic%2Fdarkplaces.git diff --git a/pr_edict.c b/pr_edict.c index 1cb4bf9c..0e8fbc6d 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -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; } } @@ -946,13 +953,12 @@ qboolean ED_ParseEpair(edict_t *ent, ddef_t *key, const char *s) { while (*s && *s <= ' ') s++; - if (!*s) - break; - val->vector[i] = atof(s); + if (*s) + val->vector[i] = atof(s); + else + val->vector[i] = 0; while (*s > ' ') s++; - if (!*s) - break; } break; @@ -1177,7 +1183,7 @@ void ED_LoadFromFile (const char *data) } pr_global_struct->self = EDICT_TO_PROG(ent); - PR_ExecuteProgram (func - pr_functions, ""); + PR_ExecuteProgram (func - pr_functions, "QC function spawn is missing"); spawned++; if (ent->e->free) died++; @@ -1235,7 +1241,7 @@ dpfield_t dpfields[] = {ev_entity, "tag_entity"}, {ev_float, "tag_index"}, {ev_float, "light_lev"}, - {ev_float, "color"}, + {ev_vector, "color"}, {ev_float, "style"}, {ev_float, "pflags"} }; @@ -1624,8 +1630,8 @@ void PR_Init (void) Cvar_RegisterVariable (&pr_boundscheck); Cvar_RegisterVariable (&pr_traceqc); - progs_mempool = Mem_AllocPool("progs.dat"); - edictstring_mempool = Mem_AllocPool("edict strings"); + progs_mempool = Mem_AllocPool("progs.dat", 0, NULL); + edictstring_mempool = Mem_AllocPool("edict strings", 0, NULL); PR_Cmd_Init(); }