interpolation needed more bounds checking

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2029 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-02-26 07:29:27 +00:00
parent 27bb33eb41
commit 7b4b590a8e

View file

@ -1598,8 +1598,13 @@ void CL_LinkPacketEntities (void)
else
{
ent->lerpfrac = 1-(servertime - le->framechange) / (le->framechange - le->oldframechange);
if (ent->lerpfrac < 0)
if (ent->lerpfrac > 1)
ent->lerpfrac = 1;
else if (ent->lerpfrac < 0)
{
ent->lerpfrac = 0;
//le->oldframechange = le->framechange;
}
}
@ -2758,10 +2763,13 @@ void CL_LinkPlayers (void)
if (state->lerpstarttime)
{
ent->lerpfrac = 1-(realtime - state->lerpstarttime)*10;
if (ent->lerpfrac < 0)
ent->lerpfrac = 0;
if (ent->lerpfrac > 1)
ent->lerpfrac = 1;
else if (ent->lerpfrac < 0)
{
ent->lerpfrac = 0;
//state->lerpstarttime = 0;
}
}
else
ent->lerpfrac = 0;