1 #include "onslaught.qh"
4 REGISTER_NET_LINKED(ENT_ONSCAMERA)
9 entity generator_camera;
10 NET_HANDLE(ENT_ONSCAMERA, bool isnew)
12 this.origin = ReadVector();
13 setorigin(this, this.origin);
15 this.angles_x = ReadAngle();
16 this.angles_y = ReadAngle();
17 this.angles_z = ReadAngle();
19 this.drawmask = MASK_NORMAL;
20 setmodel(this, MDL_Null); // give it a size for clientcamera
21 setsize(this, '-1 -1 -1', '1 1 1');
23 generator_camera = this;
27 REGISTER_MUTATOR(cl_ons, true);
30 vector generator_origin;
31 vector autocvar_cl_eventchase_generator_viewoffset = '0 0 80';
32 float autocvar_cl_eventchase_generator_distance = 400;
33 MUTATOR_HOOKFUNCTION(cl_ons, WantEventchase)
35 ons_roundlost = STAT(ROUNDLOST);
39 IL_EACH(g_onsgenerators, it.health <= 0,
45 ons_roundlost = false; // don't enforce the 3rd person camera if there is no dead generator to show
50 generator_origin = gen.origin;
56 MUTATOR_HOOKFUNCTION(cl_ons, CustomizeEventchase)
60 M_ARGV(0, vector) = generator_camera.origin;
61 M_ARGV(1, vector) = autocvar_cl_eventchase_generator_viewoffset;
62 M_ARGV(0, float) = autocvar_cl_eventchase_generator_distance;