From 4ecf408640072f668a77a26814323cdf3718ebde Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 10 Nov 2008 18:56:00 +0000 Subject: [PATCH] maybe fixed spectator jiggle (bug 2227047) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3490 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 09e974df..ea24b253 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -550,8 +550,9 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) else pl->onmoved(oldorigin.sub(pl->o)); if(pl->type==ENT_CAMERA) return; - else if(pl->type!=ENT_BOUNCE) - { + + if(pl->type!=ENT_BOUNCE && pl==player1) + { // automatically apply smooth roll when strafing if(pl->strafe==0) { @@ -564,20 +565,17 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) } // smooth pitch - if(pl==player1) + const float fric = 6.0f/curtime*20.0f; + pl->pitch += pl->pitchvel*(curtime/1000.0f)*pl->maxspeed*(pl->crouching ? 0.75f : 1.0f); + pl->pitchvel *= fric-3; + pl->pitchvel /= fric; + extern int recoiltest; + if(recoiltest) { - const float fric = 6.0f/curtime*20.0f; - pl->pitch += pl->pitchvel*(curtime/1000.0f)*pl->maxspeed*(pl->crouching ? 0.75f : 1.0f); - pl->pitchvel *= fric-3; - pl->pitchvel /= fric; - extern int recoiltest; - if(recoiltest) - { - if(pl->pitchvel < 0.05f && pl->pitchvel > 0.001f) pl->pitchvel -= recoilbackfade/100.0f; // slide back - } - else if(pl->pitchvel < 0.05f && pl->pitchvel > 0.001f) pl->pitchvel -= ((playerent *)pl)->weaponsel->info.recoilbackfade/100.0f; // slide back - if(pl->pitchvel) fixcamerarange(pl); // fix pitch if necessary + if(pl->pitchvel < 0.05f && pl->pitchvel > 0.001f) pl->pitchvel -= recoilbackfade/100.0f; // slide back } + else if(pl->pitchvel < 0.05f && pl->pitchvel > 0.001f) pl->pitchvel -= ((playerent *)pl)->weaponsel->info.recoilbackfade/100.0f; // slide back + if(pl->pitchvel) fixcamerarange(pl); // fix pitch if necessary } // play sounds on water transitions