]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
Make use of .clientcamera showing the exploding generator, this way vis is checked...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / onslaught.qc
index a30dd7d07e1c2da7b91a20edf9478d4a15e8e0d4..afbd31842978a332d81c4a3d914a2202799fddae 100644 (file)
@@ -1,7 +1,31 @@
 #include "onslaught.qh"
 
+#ifndef MENUQC
+REGISTER_NET_LINKED(ENT_ONSCAMERA)
+#endif
+
 #ifdef CSQC
 
+entity generator_camera;
+NET_HANDLE(ENT_ONSCAMERA, bool isnew)
+{
+       this.origin_x = ReadCoord();
+       this.origin_y = ReadCoord();
+       this.origin_z = ReadCoord();
+       setorigin(this, this.origin);
+
+       this.angles_x = ReadAngle();
+       this.angles_y = ReadAngle();
+       this.angles_z = ReadAngle();
+
+       this.drawmask  = MASK_NORMAL;
+       setmodel(this, MDL_Null); // give it a size for clientcamera
+       setsize(this, '-1 -1 -1', '1 1 1');
+
+       generator_camera = this;
+       return true;
+}
+
 REGISTER_MUTATOR(cl_ons, true);
 
 float ons_roundlost;
@@ -35,7 +59,7 @@ MUTATOR_HOOKFUNCTION(cl_ons, CustomizeEventchase)
 {
        if(ons_roundlost)
        {
-               M_ARGV(0, vector) = generator_origin;
+               M_ARGV(0, vector) = generator_camera.origin;
                M_ARGV(1, vector) = autocvar_cl_eventchase_generator_viewoffset;
                M_ARGV(0, float) = autocvar_cl_eventchase_generator_distance;
                return true;