added back r_speeds2, with masses of information (6 lines high), and made it print...
[xonotic/darkplaces.git] / pr_edict.c
index f327bac..0bb47d9 100644 (file)
@@ -92,6 +92,8 @@ int eval_glow_color;
 int eval_items2;
 int eval_scale;
 int eval_alpha;
 int eval_items2;
 int eval_scale;
 int eval_alpha;
+int eval_renderamt; // HalfLife support
+int eval_rendermode; // HalfLife support
 int eval_fullbright;
 int eval_ammo_shells1;
 int eval_ammo_nails1;
 int eval_fullbright;
 int eval_ammo_shells1;
 int eval_ammo_nails1;
@@ -108,6 +110,7 @@ int eval_drawonlytoclient;
 int eval_colormod;
 int eval_ping;
 int eval_movement;
 int eval_colormod;
 int eval_ping;
 int eval_movement;
+int eval_pmodel;
 
 dfunction_t *SV_PlayerPhysicsQC;
 dfunction_t *EndFrameQC;
 
 dfunction_t *SV_PlayerPhysicsQC;
 dfunction_t *EndFrameQC;
@@ -136,6 +139,8 @@ void FindEdictFieldOffsets()
        eval_items2 = FindFieldOffset("items2");
        eval_scale = FindFieldOffset("scale");
        eval_alpha = FindFieldOffset("alpha");
        eval_items2 = FindFieldOffset("items2");
        eval_scale = FindFieldOffset("scale");
        eval_alpha = FindFieldOffset("alpha");
+       eval_renderamt = FindFieldOffset("renderamt"); // HalfLife support
+       eval_rendermode = FindFieldOffset("rendermode"); // HalfLife support
        eval_fullbright = FindFieldOffset("fullbright");
        eval_ammo_shells1 = FindFieldOffset("ammo_shells1");
        eval_ammo_nails1 = FindFieldOffset("ammo_nails1");
        eval_fullbright = FindFieldOffset("fullbright");
        eval_ammo_shells1 = FindFieldOffset("ammo_shells1");
        eval_ammo_nails1 = FindFieldOffset("ammo_nails1");
@@ -152,6 +157,7 @@ void FindEdictFieldOffsets()
        eval_colormod = FindFieldOffset("colormod");
        eval_ping = FindFieldOffset("ping");
        eval_movement = FindFieldOffset("movement");
        eval_colormod = FindFieldOffset("colormod");
        eval_ping = FindFieldOffset("ping");
        eval_movement = FindFieldOffset("movement");
+       eval_pmodel = FindFieldOffset("pmodel");
 
        // LordHavoc: allowing QuakeC to override the player movement code
        SV_PlayerPhysicsQC = ED_FindFunction ("SV_PlayerPhysics");
 
        // LordHavoc: allowing QuakeC to override the player movement code
        SV_PlayerPhysicsQC = ED_FindFunction ("SV_PlayerPhysics");
@@ -201,7 +207,7 @@ edict_t *ED_Alloc (void)
        }
        
        if (i == MAX_EDICTS)
        }
        
        if (i == MAX_EDICTS)
-               Sys_Error ("ED_Alloc: no free edicts");
+               Host_Error ("ED_Alloc: no free edicts");
                
        sv.num_edicts++;
        e = EDICT_NUM(i);
                
        sv.num_edicts++;
        e = EDICT_NUM(i);
@@ -229,8 +235,8 @@ void ED_Free (edict_t *ed)
        ed->v.colormap = 0;
        ed->v.skin = 0;
        ed->v.frame = 0;
        ed->v.colormap = 0;
        ed->v.skin = 0;
        ed->v.frame = 0;
-       VectorCopy (vec3_origin, ed->v.origin);
-       VectorCopy (vec3_origin, ed->v.angles);
+       VectorClear(ed->v.origin);
+       VectorClear(ed->v.angles);
        ed->v.nextthink = -1;
        ed->v.solid = 0;
        
        ed->v.nextthink = -1;
        ed->v.solid = 0;
        
@@ -753,7 +759,7 @@ ED_ParseGlobals
 */
 void ED_ParseGlobals (char *data)
 {
 */
 void ED_ParseGlobals (char *data)
 {
-       char    keyname[64];
+       char    keyname[1024]; // LordHavoc: good idea? bad idea?  was 64
        ddef_t  *key;
 
        while (1)
        ddef_t  *key;
 
        while (1)
@@ -801,7 +807,7 @@ char *ED_NewString (char *string)
        int             i,l;
        
        l = strlen(string) + 1;
        int             i,l;
        
        l = strlen(string) + 1;
-       new = Hunk_Alloc (l);
+       new = Hunk_AllocName (l, "edict string");
        new_p = new;
 
        for (i=0 ; i< l ; i++)
        new_p = new;
 
        for (i=0 ; i< l ; i++)
@@ -874,7 +880,7 @@ qboolean    ED_ParseEpair (void *base, ddef_t *key, char *s)
                if (!def)
                {
                        // LordHavoc: don't warn about worldspawn sky/fog fields because they don't require mod support
                if (!def)
                {
                        // LordHavoc: don't warn about worldspawn sky/fog fields because they don't require mod support
-                       if (strcmp(s, "sky") && strncmp(s, "fog_", 4) && strcmp(s, "skyboxsize"))
+                       if (strcmp(s, "sky") && strcmp(s, "fog") && strncmp(s, "fog_", 4) && strcmp(s, "farclip"))
                                Con_DPrintf ("Can't find field %s\n", s);
                        return false;
                }
                                Con_DPrintf ("Can't find field %s\n", s);
                        return false;
                }
@@ -1027,7 +1033,7 @@ void ED_LoadFromFile (char *data)
                if (!data)
                        break;
                if (com_token[0] != '{')
                if (!data)
                        break;
                if (com_token[0] != '{')
-                       Sys_Error ("ED_LoadFromFile: found %s when expecting {",com_token);
+                       Host_Error ("ED_LoadFromFile: found %s when expecting {",com_token);
 
                if (!ent)
                        ent = EDICT_NUM(0);
 
                if (!ent)
                        ent = EDICT_NUM(0);
@@ -1317,7 +1323,7 @@ void PR_Init (void)
 // LordHavoc: turned EDICT_NUM into a #define for speed reasons
 edict_t *EDICT_NUM_ERROR(int n)
 {
 // LordHavoc: turned EDICT_NUM into a #define for speed reasons
 edict_t *EDICT_NUM_ERROR(int n)
 {
-       Sys_Error ("EDICT_NUM: bad number %i", n);
+       Host_Error ("EDICT_NUM: bad number %i", n);
        return NULL;
 }
 /*
        return NULL;
 }
 /*
@@ -1337,6 +1343,6 @@ int NUM_FOR_EDICT(edict_t *e)
        b = b / pr_edict_size;
        
        if (b < 0 || b >= sv.num_edicts)
        b = b / pr_edict_size;
        
        if (b < 0 || b >= sv.num_edicts)
-               Sys_Error ("NUM_FOR_EDICT: bad pointer");
+               Host_Error ("NUM_FOR_EDICT: bad pointer");
        return b;
 }
        return b;
 }