]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_edict.c
now checks that a lightmap surfacechain is not NULL before dereferencing it
[xonotic/darkplaces.git] / pr_edict.c
index 4643f3e44f2510ef850821ff423bb68def1be512..0e8fbc6db55d805ba03db37a742a44e3ca2c1a59 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;
        }
 }
 
@@ -1176,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++;
@@ -1234,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"}
 };
@@ -1623,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();
 }