From dcf0f95e28697a59859e81a9bd0228cf5108ecad Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 9 Jun 2008 21:22:00 +0000 Subject: [PATCH] movement interp bug fix git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2168 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 951ef6b6..185cc148 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -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)