]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/misc/laser.qc
Propagate this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / misc / laser.qc
index 8fe240f6f7db278d5fb322a95e67731f7f6d78e6..48e23a287d68de3c00eeeb1af9bf9a1531da0882 100644 (file)
@@ -1,7 +1,7 @@
 #if defined(CSQC)
-       #include "../../../lib/csqcmodel/interpolate.qh"
-       #include "../../../client/main.qh"
-       #include "../../../lib/csqcmodel/cl_model.qh"
+       #include <lib/csqcmodel/interpolate.qh>
+       #include <client/main.qh>
+       #include <lib/csqcmodel/cl_model.qh>
 #elif defined(MENUQC)
 #elif defined(SVQC)
 #endif
@@ -49,8 +49,8 @@ void misc_laser_aim()
        }
 }
 
-void misc_laser_init()
-{SELFPARAM();
+void misc_laser_init(entity this)
+{
        if(self.target != "")
                self.enemy = find(world, targetname, self.target);
 }
@@ -98,7 +98,7 @@ void misc_laser_think()
                                self.count = 1;
 
                                activator = self.enemy.pusher;
-                               WITH(entity, self, self.enemy, SUB_UseTargets());
+                               WITHSELF(self.enemy, SUB_UseTargets());
                        }
                }
                else
@@ -108,7 +108,7 @@ void misc_laser_think()
                                self.count = 0;
 
                                activator = self.enemy.pusher;
-                               WITH(entity, self, self.enemy, SUB_UseTargets());
+                               WITHSELF(self.enemy, SUB_UseTargets());
                        }
                }
        }
@@ -268,58 +268,58 @@ class(Laser) .float modelscale; // scaling factor of the dlight
 
 void Draw_Laser(entity this)
 {
-       if(!self.state)
+       if(!this.state)
                return;
-       InterpolateOrigin_Do();
-       if(self.count & 0x80)
+       InterpolateOrigin_Do(this);
+       if(this.count & 0x80)
        {
-               if(self.count & 0x10)
+               if(this.count & 0x10)
                {
-                       trace_endpos = self.velocity;
+                       trace_endpos = this.velocity;
                        trace_dphitq3surfaceflags = 0;
                }
                else
-                       traceline(self.origin, self.velocity, 0, self);
+                       traceline(this.origin, this.velocity, 0, this);
        }
        else
        {
-               if(self.count & 0x10)
+               if(this.count & 0x10)
                {
-                       makevectors(self.angles);
-                       trace_endpos = self.origin + v_forward * 1048576;
+                       makevectors(this.angles);
+                       trace_endpos = this.origin + v_forward * 1048576;
                        trace_dphitq3surfaceflags = Q3SURFACEFLAG_SKY;
                }
                else
                {
-                       makevectors(self.angles);
-                       traceline(self.origin, self.origin + v_forward * 32768, 0, self);
+                       makevectors(this.angles);
+                       traceline(this.origin, this.origin + v_forward * 32768, 0, this);
                        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
-                               trace_endpos = self.origin + v_forward * 1048576;
+                               trace_endpos = this.origin + v_forward * 1048576;
                }
        }
-       if(self.scale != 0)
+       if(this.scale != 0)
        {
-               if(self.alpha)
+               if(this.alpha)
                {
-                       Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, self.alpha, DRAWFLAG_NORMAL, view_origin);
+                       Draw_CylindricLine(this.origin, trace_endpos, this.scale, "particles/laserbeam", 0, time * 3, this.colormod, this.alpha, DRAWFLAG_NORMAL, view_origin);
                }
                else
                {
-                       Draw_CylindricLine(self.origin, trace_endpos, self.scale, "particles/laserbeam", 0, time * 3, self.colormod, 0.5, DRAWFLAG_ADDITIVE, view_origin);
+                       Draw_CylindricLine(this.origin, trace_endpos, this.scale, "particles/laserbeam", 0, time * 3, this.colormod, 0.5, DRAWFLAG_ADDITIVE, view_origin);
                }
        }
        if (!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
        {
-               if(self.cnt >= 0)
-                       __pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000);
-               if(self.colormod != '0 0 0' && self.modelscale != 0)
-                       adddynamiclight(trace_endpos + trace_plane_normal * 1, self.modelscale, self.colormod * 5);
+               if(this.cnt >= 0)
+                       __pointparticles(this.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000);
+               if(this.colormod != '0 0 0' && this.modelscale != 0)
+                       adddynamiclight(trace_endpos + trace_plane_normal * 1, this.modelscale, this.colormod * 5);
        }
 }
 
 NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
 {
-       InterpolateOrigin_Undo();
+       InterpolateOrigin_Undo(self);
 
        // 30 bytes, or 13 bytes for just moving
        int f = ReadByte();
@@ -377,7 +377,7 @@ NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
 
        return = true;
 
-       InterpolateOrigin_Note();
+       InterpolateOrigin_Note(this);
        self.draw = Draw_Laser;
 }
 #endif