1 #include "onslaught.qh"
4 REGISTER_NET_LINKED(ENT_ONSCAMERA)
9 entity generator_camera;
10 NET_HANDLE(ENT_ONSCAMERA, bool isnew)
12 this.origin_x = ReadCoord();
13 this.origin_y = ReadCoord();
14 this.origin_z = ReadCoord();
15 setorigin(this, this.origin);
17 this.angles_x = ReadAngle();
18 this.angles_y = ReadAngle();
19 this.angles_z = ReadAngle();
21 this.drawmask = MASK_NORMAL;
22 setmodel(this, MDL_Null); // give it a size for clientcamera
23 setsize(this, '-1 -1 -1', '1 1 1');
25 generator_camera = this;
29 REGISTER_MUTATOR(cl_ons, true);
32 vector generator_origin;
33 vector autocvar_cl_eventchase_generator_viewoffset = '0 0 80';
34 float autocvar_cl_eventchase_generator_distance = 400;
35 MUTATOR_HOOKFUNCTION(cl_ons, WantEventchase)
37 ons_roundlost = STAT(ROUNDLOST);
41 IL_EACH(g_onsgenerators, it.health <= 0,
47 ons_roundlost = false; // don't enforce the 3rd person camera if there is no dead generator to show
52 generator_origin = gen.origin;
58 MUTATOR_HOOKFUNCTION(cl_ons, CustomizeEventchase)
62 M_ARGV(0, vector) = generator_camera.origin;
63 M_ARGV(1, vector) = autocvar_cl_eventchase_generator_viewoffset;
64 M_ARGV(0, float) = autocvar_cl_eventchase_generator_distance;