]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/misc/laser.qc
improve descriptions, add missing cvar to config
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / misc / laser.qc
index 15c7e26301daed6d06699502447e5bfb9fa2eeed..3d5ef42d848bd7c745a7316690cb5271436baced 100644 (file)
@@ -1,3 +1,4 @@
+#include "laser.qh"
 #if defined(CSQC)
        #include <lib/csqcmodel/interpolate.qh>
        #include <client/main.qh>
@@ -52,7 +53,7 @@ void misc_laser_aim(entity this)
 void misc_laser_init(entity this)
 {
        if(this.target != "")
-               this.enemy = find(world, targetname, this.target);
+               this.enemy = find(NULL, targetname, this.target);
 }
 
 .entity pusher;
@@ -117,7 +118,7 @@ void misc_laser_think(entity this)
                        if(((this.spawnflags & 8) == 0) == (this.team != hitent.team))
                                return;
                if(hitent.takedamage)
-                       Damage(hitent, this, this, ((this.dmg < 0) ? 100000 : (this.dmg * frametime)), DEATH_HURTTRIGGER.m_id, hitloc, '0 0 0');
+                       Damage(hitent, this, this, ((this.dmg < 0) ? 100000 : (this.dmg * frametime)), DEATH_HURTTRIGGER.m_id, DMG_NOWEP, hitloc, '0 0 0');
        }
 }
 
@@ -136,9 +137,7 @@ bool laser_SendEntity(entity this, entity to, float fl)
        WriteByte(MSG_ENTITY, fl);
        if(fl & 1)
        {
-               WriteCoord(MSG_ENTITY, this.origin_x);
-               WriteCoord(MSG_ENTITY, this.origin_y);
-               WriteCoord(MSG_ENTITY, this.origin_z);
+               WriteVector(MSG_ENTITY, this.origin);
        }
        if(fl & 8)
        {
@@ -159,9 +158,7 @@ bool laser_SendEntity(entity this, entity to, float fl)
        {
                if(fl & 0x80)
                {
-                       WriteCoord(MSG_ENTITY, this.enemy.origin_x);
-                       WriteCoord(MSG_ENTITY, this.enemy.origin_y);
-                       WriteCoord(MSG_ENTITY, this.enemy.origin_z);
+                       WriteVector(MSG_ENTITY, this.enemy.origin);
                }
                else
                {
@@ -330,9 +327,7 @@ NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
 
        if(f & 1)
        {
-               this.origin_x = ReadCoord();
-               this.origin_y = ReadCoord();
-               this.origin_z = ReadCoord();
+               this.origin = ReadVector();
                setorigin(this, this.origin);
        }
        if(f & 8)
@@ -360,9 +355,7 @@ NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
        {
                if(f & 0x80)
                {
-                       this.velocity_x = ReadCoord();
-                       this.velocity_y = ReadCoord();
-                       this.velocity_z = ReadCoord();
+                       this.velocity = ReadVector();
                }
                else
                {
@@ -377,5 +370,6 @@ NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
 
        InterpolateOrigin_Note(this);
        this.draw = Draw_Laser;
+       if (isnew) IL_PUSH(g_drawables, this);
 }
 #endif