From b6484d3f6614cb398288e89e105f5a7f67dca7ce Mon Sep 17 00:00:00 2001 From: Forest Hale Date: Tue, 4 Jul 2000 00:49:01 +0000 Subject: [PATCH] Fix for long standing baseline bug (OUCH!), should fix invis problems... --- source/cl_ents.c | 20 +++----------------- source/cl_parse.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/source/cl_ents.c b/source/cl_ents.c index 3115a6e..0f53c22 100644 --- a/source/cl_ents.c +++ b/source/cl_ents.c @@ -257,24 +257,16 @@ void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int bits) // Ender (QSG - Begin) if (bits & U_ALPHA) to->alpha = MSG_ReadByte(); - else if (!to->alpha) - to->alpha = 1; if (bits & U_SCALE) to->scale = MSG_ReadByte(); - else if (!to->scale) - to->scale = 16; if (bits & U_EFFECTS2) to->effects = (to->effects & 0xFF) | (MSG_ReadByte() << 8); if (bits & U_GLOWSIZE) to->glowsize = MSG_ReadByte(); if (bits & U_GLOWCOLOR) to->glowcolor = MSG_ReadByte(); - else if (!to->glowcolor) - to->glowcolor = 254; if (bits & U_COLORMOD) to->colormod = MSG_ReadByte(); - else if (!to->colormod) - to->colormod = 255; if (bits & U_FRAME2) to->frame = (to->frame & 0xFF) | (MSG_ReadByte() << 8); // Ender (QSG - End) @@ -312,12 +304,6 @@ void FlushEntityPacket (void) Con_DPrintf ("FlushEntityPacket\n"); memset (&olde, 0, sizeof(olde)); - // LordHavoc: more state setup... - olde.alpha = 255; - olde.scale = 16; - olde.glowsize = 0; - olde.glowcolor = 254; - olde.colormod = 255; cl.validsequence = 0; // can't render a frame cl.frames[cls.netchan.incoming_sequence&UPDATE_MASK].invalid = true; @@ -729,15 +715,15 @@ void CL_LinkProjectiles (void) for (i=0, pr=cl_projectiles ; imodelindex < 1) + continue; + // grab an entity to fill in if (cl_numvisedicts == MAX_VISEDICTS) break; // object list is full ent = &cl_visedicts[cl_numvisedicts]; cl_numvisedicts++; ent->keynum = 0; - - if (pr->modelindex < 1) - continue; ent->model = cl.model_precache[pr->modelindex]; ent->skinnum = 0; ent->frame = 0; diff --git a/source/cl_parse.c b/source/cl_parse.c index 83ce573..61317d7 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -544,6 +544,7 @@ void CL_StopUpload(void) void Draw_ClearCache (void); +void CL_ClearBaselines(); // LordHavoc: BIG BUG-FIX! /* ================== CL_ParseServerData @@ -649,6 +650,23 @@ void CL_ParseServerData (void) // now waiting for downloads, etc cls.state = ca_onserver; + + CL_ClearBaselines(); +} + +// LordHavoc: BIG BUG-FIX! Clear baselines each time it connects... +void CL_ClearBaselines() +{ + int i; + memset(cl_baselines, 0, sizeof(cl_baselines)); + for (i = 0;i < MAX_EDICTS;i++) + { + cl_baselines[i].alpha = 255; + cl_baselines[i].scale = 16; + cl_baselines[i].glowcolor = 254; + cl_baselines[i].glowsize = 0; + cl_baselines[i].colormod = 255; + } } /*