]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/view.c
set FL_NOTARGET flag for spectators/observers
[divverent/nexuiz.git] / data / qcsrc / client / view.c
1 float max_ups;
2 vector angle_alive;
3
4 void View_Update (void)
5 {
6         float f;
7         string s;
8
9         vieworg = pmove_org;
10         angle_alive = input_angles;
11
12         if(player_flags & PFL_DEAD)
13         {
14                 R_SetView(VF_ORIGIN, vieworg+'0 0 4');
15                 angle_alive_z = 80;
16                 R_SetView(VF_ANGLES, angle_alive);
17                 R_SetView(VF_CL_VIEWANGLES, angle_alive);
18                 return;
19         }
20
21         if(input_buttons & 16 && getstati(STAT_HEALTH) != 6666)
22                 vieworg += PL_CROUCH_VIEW_OFS;
23         else
24                 vieworg += PL_VIEW_OFS;
25
26         R_SetView(VF_ORIGIN, vieworg);
27         R_SetView(VF_ANGLES, input_angles);
28
29         cprint(ftos(input_buttons));
30
31         if(!cvar("cg_showvelocity"))
32                 return;
33
34         f = pl_xyspeed;
35         if(max_ups < f)
36                 max_ups = f;
37         s = ftos(f);
38         s = strcat(s, " ups");
39         drawstring('1 0 0'*vid_width + '-64 64 0', s, '8 8 0', VEC_1, 1, 0);
40         s = ftos(max_ups);
41         s = strcat(s, " max");
42         drawstring('1 0 0'*vid_width + '-64 72 0', s, '8 8 0', VEC_1, 1, 0);
43 }