mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-21 07:51:03 +00:00
------------------------------------------------------------------------
r4243 | acceptthis | 2013-03-08 02:46:54 +0000 (Fri, 08 Mar 2013) | 1 line Make viewheight obey gravitydir. This just feels more natural. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4239 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c6b6c12a6e
commit
de2abac8f9
1 changed files with 9 additions and 9 deletions
|
@ -1020,6 +1020,7 @@ void V_CalcRefdef (int pnum)
|
||||||
entity_t *view;
|
entity_t *view;
|
||||||
int i;
|
int i;
|
||||||
float bob;
|
float bob;
|
||||||
|
float viewheight;
|
||||||
|
|
||||||
r_refdef.currentplayernum = pnum;
|
r_refdef.currentplayernum = pnum;
|
||||||
|
|
||||||
|
@ -1090,19 +1091,16 @@ void V_CalcRefdef (int pnum)
|
||||||
V_CalcViewRoll (pnum);
|
V_CalcViewRoll (pnum);
|
||||||
V_AddIdle (pnum);
|
V_AddIdle (pnum);
|
||||||
|
|
||||||
if (cl.viewheight[pnum] == DEFAULT_VIEWHEIGHT)
|
viewheight = cl.viewheight[pnum];
|
||||||
|
if (viewheight == DEFAULT_VIEWHEIGHT)
|
||||||
{
|
{
|
||||||
if (view_message && view_message->flags & PF_GIB)
|
if (view_message && view_message->flags & PF_GIB)
|
||||||
r_refdef.vieworg[2] += 8; // gib view height
|
viewheight = 8; // gib view height
|
||||||
else if (view_message && view_message->flags & PF_DEAD)
|
else if (view_message && view_message->flags & PF_DEAD)
|
||||||
r_refdef.vieworg[2] -= 16; // corpse view height
|
viewheight = 16; // corpse view height
|
||||||
else
|
|
||||||
r_refdef.vieworg[2] += DEFAULT_VIEWHEIGHT;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
r_refdef.vieworg[2] += cl.viewheight[pnum];
|
|
||||||
|
|
||||||
r_refdef.vieworg[2] += cl.crouch[pnum];
|
viewheight += cl.crouch[pnum];
|
||||||
|
|
||||||
if (view_message && view_message->flags & PF_DEAD && v_deathtilt.value) // PF_GIB will also set PF_DEAD
|
if (view_message && view_message->flags & PF_DEAD && v_deathtilt.value) // PF_GIB will also set PF_DEAD
|
||||||
{
|
{
|
||||||
|
@ -1112,9 +1110,11 @@ void V_CalcRefdef (int pnum)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// v_viewheight only affects the view if the player is alive
|
// v_viewheight only affects the view if the player is alive
|
||||||
r_refdef.vieworg[2] += bob;
|
viewheight += bob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VectorMA(r_refdef.vieworg, -viewheight, cl.playerview[pnum].gravitydir, r_refdef.vieworg);
|
||||||
|
|
||||||
// set up gun position
|
// set up gun position
|
||||||
V_CalcGunPositionAngle (pnum, bob);
|
V_CalcGunPositionAngle (pnum, bob);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue