1 #include "onslaught.qh"
3 #include <common/mutators/base.qh>
6 REGISTER_NET_LINKED(ENT_ONSCAMERA)
11 entity generator_camera;
12 NET_HANDLE(ENT_ONSCAMERA, bool isnew)
14 this.origin = ReadVector();
15 setorigin(this, this.origin);
17 this.angles = ReadAngleVector();
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, GetResource(it, RES_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;