From: havoc Date: Thu, 5 Jun 2008 07:41:03 +0000 (+0000) Subject: add view_ofs before chase_active code, this should fix a bug in prophecy X-Git-Tag: xonotic-v0.1.0preview~2222 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f7061776e788fa35013545d1440f785936c4e36d;p=xonotic%2Fdarkplaces.git add view_ofs before chase_active code, this should fix a bug in prophecy where the camera trace starts at the player's feet and glitches on stairs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8328 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/view.c b/view.c index 5af9ff13..431a78ae 100644 --- a/view.c +++ b/view.c @@ -390,6 +390,9 @@ void V_CalcRefdef (void) // TODO: add a cvar to disable this viewangles[PITCH] += cl.qw_weaponkick; + // apply the viewofs (even if chasecam is used) + vieworg[2] += cl.stats[STAT_VIEWHEIGHT]; + if (chase_active.value) { // observing entity from third person. Added "campitch" by Alexander "motorsep" Zubov @@ -399,9 +402,6 @@ void V_CalcRefdef (void) camup = chase_up.value; campitch = chase_pitchangle.value; - // this + 22 is to match view_ofs for compatibility with older versions - camup += 22; - AngleVectors(viewangles, forward, NULL, NULL); if (chase_overhead.integer) @@ -423,6 +423,7 @@ void V_CalcRefdef (void) VectorCopy(trace.endpos, vieworg); vieworg[2] -= 8; #else + // trace from first person view location to our chosen third person view location trace = CL_Move(vieworg, camboxmins, camboxmaxs, chase_dest, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_SKY, true, false, NULL, false); VectorCopy(trace.endpos, bestvieworg); offset[2] = 0; @@ -478,7 +479,6 @@ void V_CalcRefdef (void) } // origin VectorAdd(vieworg, cl.punchvector, vieworg); - vieworg[2] += cl.stats[STAT_VIEWHEIGHT]; if (cl.stats[STAT_HEALTH] > 0) { double xyspeed, bob;