From d1a6da2c356ffcaf0a4d42f328d289f8c2c6dd7f Mon Sep 17 00:00:00 2001 From: driAn Date: Sun, 5 Oct 2008 13:10:37 +0000 Subject: [PATCH] avoid unnecessary phys cycles in volume-resize git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2839 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 9920b4d4..64a88a3c 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -261,6 +261,8 @@ VAR(recoilbackfade, 0, 100, 1000); void resizephysent(physent *pl, int moveres, int curtime, float min, float max) { + if(pl->eyeheightvel==0.0f) return; + float drop = 0.0f, rise = 0.0f; const bool water = hdr.waterlevel>pl->o.z; const float speed = curtime*pl->maxspeed/(water ? 2000.0f : 1000.0f); @@ -279,11 +281,13 @@ void resizephysent(physent *pl, int moveres, int curtime, float min, float max) if(pl->eyeheighteyeheight = min; + pl->eyeheightvel = 0.0f; break; } if(pl->eyeheight>max) { pl->eyeheight = max; + pl->eyeheightvel = 0.0f; break; } }