X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=pr_edict.c;h=0bb47d99be013566ef4ce6c0a703018d55ec1bd2;hp=f327bac204ebffe4230b9de2d3d6299cfac11877;hb=6a384398c93b7e2bc1936427797909eb60094160;hpb=8dcce44300385b12c46d494c06aadcfa35a8bc14;ds=sidebyside diff --git a/pr_edict.c b/pr_edict.c index f327bac2..0bb47d99 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -92,6 +92,8 @@ int eval_glow_color; 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; @@ -108,6 +110,7 @@ int eval_drawonlytoclient; int eval_colormod; int eval_ping; int eval_movement; +int eval_pmodel; 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_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"); @@ -152,6 +157,7 @@ void FindEdictFieldOffsets() 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"); @@ -201,7 +207,7 @@ edict_t *ED_Alloc (void) } 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); @@ -229,8 +235,8 @@ void ED_Free (edict_t *ed) 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; @@ -753,7 +759,7 @@ ED_ParseGlobals */ void ED_ParseGlobals (char *data) { - char keyname[64]; + char keyname[1024]; // LordHavoc: good idea? bad idea? was 64 ddef_t *key; while (1) @@ -801,7 +807,7 @@ char *ED_NewString (char *string) 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++) @@ -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 (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; } @@ -1027,7 +1033,7 @@ void ED_LoadFromFile (char *data) 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); @@ -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) { - Sys_Error ("EDICT_NUM: bad number %i", n); + Host_Error ("EDICT_NUM: bad number %i", n); 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) - Sys_Error ("NUM_FOR_EDICT: bad pointer"); + Host_Error ("NUM_FOR_EDICT: bad pointer"); return b; }