]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_edict.c
now shows status messages in join game menu when a server is typed in manually (it...
[xonotic/darkplaces.git] / pr_edict.c
index 2f512093eff786f34dd3361aa4383d9999e0747c..0482bcfda4a50aa740351103f08cc05bc13e3464 100644 (file)
@@ -401,7 +401,7 @@ char *PR_ValueString (etype_t type, eval_t *val)
        switch (type)
        {
        case ev_string:
-               strncpy(line, PR_GetString(val->string), sizeof(line));
+               strlcpy (line, PR_GetString (val->string), sizeof (line));
                break;
        case ev_entity:
                //n = NoCrash_NUM_FOR_EDICT(PROG_TO_EDICT(val->edict));
@@ -489,7 +489,7 @@ char *PR_UglyValueString (etype_t type, eval_t *val)
                break;
        case ev_function:
                f = pr_functions + val->function;
-               strncpy(line, PR_GetString(f->s_name), sizeof(line));
+               strlcpy (line, PR_GetString (f->s_name), sizeof (line));
                break;
        case ev_field:
                def = ED_FieldAtOfs ( val->_int );
@@ -614,7 +614,7 @@ void ED_Print(edict_t *ed)
 
                if (strlen(name) > 256)
                {
-                       strncpy(tempstring2, name, 256);
+                       memcpy (tempstring2, name, 256);
                        tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
                        tempstring2[259] = 0;
                        name = tempstring2;
@@ -627,7 +627,7 @@ void ED_Print(edict_t *ed)
                name = PR_ValueString(d->type, (eval_t *)v);
                if (strlen(name) > 256)
                {
-                       strncpy(tempstring2, name, 256);
+                       memcpy(tempstring2, name, 256);
                        tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
                        tempstring2[259] = 0;
                        name = tempstring2;
@@ -946,13 +946,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 +1176,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 +1234,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"}
 };
@@ -1537,7 +1536,7 @@ void PR_Fields_f (void)
                }
                if (strlen(name) > 256)
                {
-                       strncpy(tempstring2, name, 256);
+                       memcpy(tempstring2, name, 256);
                        tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
                        tempstring2[259] = 0;
                        name = tempstring2;
@@ -1624,8 +1623,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();
 }