]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/misc/laser.qc
Merge branch 'terencehill/announcer_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / misc / laser.qc
index 52d2caf65aada325c89e45404952dc4dde407b90..8bfa35f40da77688d516a8e36688628e766781c6 100644 (file)
@@ -1,13 +1,13 @@
 #if defined(CSQC)
-       #include "../../../client/_all.qh"
-       #include "../../buffs.qh"
-       #include "../../../csqcmodellib/interpolate.qh"
+       #include "../../../lib/csqcmodel/interpolate.qh"
        #include "../../../client/main.qh"
-       #include "../../../csqcmodellib/cl_model.qh"
+       #include "../../../lib/csqcmodel/cl_model.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
 #endif
 
+REGISTER_NET_LINKED(ENT_CLIENT_LASER)
+
 #ifdef SVQC
 .float modelscale;
 void misc_laser_aim()
@@ -119,13 +119,13 @@ void misc_laser_think()
                        if(((self.spawnflags & 8) == 0) == (self.team != hitent.team))
                                return;
                if(hitent.takedamage)
-                       Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
+                       Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER.m_id, hitloc, '0 0 0');
        }
 }
 
-float laser_SendEntity(entity to, float fl)
-{SELFPARAM();
-       WriteByte(MSG_ENTITY, ENT_CLIENT_LASER);
+bool laser_SendEntity(entity this, entity to, float fl)
+{
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_LASER);
        fl = fl - (fl & 0xF0); // use that bit to indicate finite length laser
        if(self.spawnflags & 2)
                fl |= 0x80;
@@ -203,8 +203,8 @@ void laser_reset()
                self.state = 0;
 }
 
-void spawnfunc_misc_laser()
-{SELFPARAM();
+spawnfunc(misc_laser)
+{
        if(self.mdl)
        {
                if(self.mdl == "none")
@@ -272,8 +272,8 @@ class(Laser) .float alpha;
 class(Laser) .float scale; // scaling factor of the thickness
 class(Laser) .float modelscale; // scaling factor of the dlight
 
-void Draw_Laser()
-{SELFPARAM();
+void Draw_Laser(entity this)
+{
        if(!self.state)
                return;
        InterpolateOrigin_Do();
@@ -317,14 +317,14 @@ void Draw_Laser()
        if (!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
        {
                if(self.cnt >= 0)
-                       pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000);
+                       __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);
        }
 }
 
-void Ent_Laser()
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
+{
        InterpolateOrigin_Undo();
 
        // 30 bytes, or 13 bytes for just moving
@@ -380,6 +380,9 @@ void Ent_Laser()
        }
        if(f & 4)
                self.state = ReadByte();
+
+       return = true;
+
        InterpolateOrigin_Note();
        self.draw = Draw_Laser;
 }