]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_edict.c
S_LoadSound now automatically tries both with and without sound/ when loading sounds...
[xonotic/darkplaces.git] / pr_edict.c
index 1cb4bf9cd1564f5547245b4c14599196c33d99d4..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;
        }
 }
 
@@ -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();
 }