movement interp bug fix

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2168 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-06-09 21:22:00 +00:00
parent afbdae9e96
commit dcf0f95e28
+4 -2
View File
@@ -503,16 +503,18 @@ void physicsframe() // optimally schedule physics frames inside the gra
}
}
VAR(physinterp, 0, 1, 1);
void interppos(physent *pl)
{
pl->o = pl->newpos;
int diff = lastphysframe - (lastmillis + curtime);
if(diff <= 0) return;
if(diff <= 0 || !physinterp) return;
vec deltapos(pl->deltapos);
deltapos.mul(min(diff, physframetime)/float(physframetime));
pl->o.sub(deltapos);
pl->o.add(deltapos);
}
void moveplayer(physent *pl, int moveres, bool local)