Handle our spanned snapshots a bit better by not messing up interpolation.

This commit is contained in:
Shpoike 2021-05-11 20:47:22 +01:00
parent d6fd6076b8
commit 734234c5db

View file

@ -242,6 +242,15 @@ static unsigned int CLFTE_ReadDelta(unsigned int entnum, entity_state_t *news, c
else if (!olds) else if (!olds)
{ {
/*reset got lost, probably the data will be filled in later - FIXME: we should probably ignore this entity*/ /*reset got lost, probably the data will be filled in later - FIXME: we should probably ignore this entity*/
if (sv.active)
{ //for extra debug info
qcvm_t *old = qcvm;
qcvm = NULL;
PR_SwitchQCVM(&sv.qcvm);
Con_DPrintf("New entity %i(%s / %s) without reset\n", entnum, PR_GetString(EDICT_NUM(entnum)->v.classname), PR_GetString(EDICT_NUM(entnum)->v.model));
PR_SwitchQCVM(old);
}
else
Con_DPrintf("New entity %i without reset\n", entnum); Con_DPrintf("New entity %i without reset\n", entnum);
*news = nullentitystate; *news = nullentitystate;
} }
@ -555,6 +564,10 @@ static void CL_EntitiesDeltaed(void)
if (!ent->update_type) if (!ent->update_type)
continue; //not interested in this one continue; //not interested in this one
if (ent->msgtime == cl.mtime[0])
forcelink = false; //update got fragmented, don't dirty anything.
else
{
if (ent->msgtime != cl.mtime[1]) if (ent->msgtime != cl.mtime[1])
forcelink = true; // no previous frame to lerp from forcelink = true; // no previous frame to lerp from
else else
@ -566,6 +579,13 @@ static void CL_EntitiesDeltaed(void)
ent->msgtime = cl.mtime[0]; ent->msgtime = cl.mtime[0];
// shift the known values for interpolation
VectorCopy (ent->msg_origins[0], ent->msg_origins[1]);
VectorCopy (ent->msg_angles[0], ent->msg_angles[1]);
VectorCopy (ent->netstate.origin, ent->msg_origins[0]);
VectorCopy (ent->netstate.angles, ent->msg_angles[0]);
}
skin = ent->netstate.skin; skin = ent->netstate.skin;
if (skin != ent->skinnum) if (skin != ent->skinnum)
{ {
@ -575,13 +595,6 @@ static void CL_EntitiesDeltaed(void)
} }
ent->effects = ent->netstate.effects; ent->effects = ent->netstate.effects;
// shift the known values for interpolation
VectorCopy (ent->msg_origins[0], ent->msg_origins[1]);
VectorCopy (ent->msg_angles[0], ent->msg_angles[1]);
VectorCopy (ent->netstate.origin, ent->msg_origins[0]);
VectorCopy (ent->netstate.angles, ent->msg_angles[0]);
//johnfitz -- lerping for movetype_step entities //johnfitz -- lerping for movetype_step entities
if (ent->netstate.eflags & EFLAGS_STEP) if (ent->netstate.eflags & EFLAGS_STEP)
{ {