fixed some bugs and design flaws in the csqc code, it works better now
[divverent/nexuiz.git] / data / qcsrc / client / view.c
1 float max_ups;
2 vector angle_alive;
3
4 void View_Update (void)
5 {
6         vieworg = pmove_org;
7         angle_alive = input_angles;
8         makevectors(input_angles);
9
10         if(player_flags & PFL_DEAD && !spec)
11         {
12                 R_SetView(VF_ORIGIN, vieworg+'0 0 4');
13                 angle_alive_z = 80;
14                 R_SetView(VF_ANGLES, angle_alive);
15                 R_SetView(VF_CL_VIEWANGLES, angle_alive);
16                 return;
17         }
18
19         if(input_buttons & 16 && !spec)
20                 vieworg += PL_CROUCH_VIEW_OFS;
21         else
22                 vieworg += PL_VIEW_OFS;
23
24         if(cvar("chase_active") && !spec)
25                 vieworg = vieworg + v_up * cvar("chase_up") - v_forward * cvar("chase_back");
26
27         R_SetView(VF_ORIGIN, vieworg);
28         R_SetView(VF_ANGLES, input_angles);
29 }