]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/csqcprojectile.qc
spawnfunc and SendEntity3 have a 'this' parameter, use it
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / csqcprojectile.qc
index f3e9f22ef6859a2b8e538a39e6b14be0b602c92f..0edf22664ae8eba7e89fff4851c5c98001019b17 100644 (file)
@@ -16,22 +16,22 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
        // note: flag 0x08 = no trail please (teleport bit)
        sf = sf & 0x0F;
 
-       if(self.csqcprojectile_clientanimate)
+       if(this.csqcprojectile_clientanimate)
                sf |= 0x80; // client animated, not interpolated
 
-       if(IS_ONGROUND(self))
+       if(IS_ONGROUND(this))
                sf |= 0x40;
 
        ft = fr = 0;
-       if(self.fade_time != 0 || self.fade_rate != 0)
+       if(this.fade_time != 0 || this.fade_rate != 0)
        {
-               ft = (self.fade_time - time) / sys_frametime;
-               fr = (1 / self.fade_rate) / sys_frametime;
+               ft = (this.fade_time - time) / sys_frametime;
+               fr = (1 / this.fade_rate) / sys_frametime;
                if(ft <= 255 && fr <= 255 && fr >= 1)
                        sf |= 0x20;
        }
 
-       if(self.gravity != 0)
+       if(this.gravity != 0)
                sf |= 0x10;
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_PROJECTILE);
@@ -39,17 +39,17 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
 
        if(sf & 1)
        {
-               WriteCoord(MSG_ENTITY, self.origin.x);
-               WriteCoord(MSG_ENTITY, self.origin.y);
-               WriteCoord(MSG_ENTITY, self.origin.z);
+               WriteCoord(MSG_ENTITY, this.origin.x);
+               WriteCoord(MSG_ENTITY, this.origin.y);
+               WriteCoord(MSG_ENTITY, this.origin.z);
 
                if(sf & 0x80)
                {
-                       WriteCoord(MSG_ENTITY, self.velocity.x);
-                       WriteCoord(MSG_ENTITY, self.velocity.y);
-                       WriteCoord(MSG_ENTITY, self.velocity.z);
+                       WriteCoord(MSG_ENTITY, this.velocity.x);
+                       WriteCoord(MSG_ENTITY, this.velocity.y);
+                       WriteCoord(MSG_ENTITY, this.velocity.z);
                        if(sf & 0x10)
-                               WriteCoord(MSG_ENTITY, self.gravity);
+                               WriteCoord(MSG_ENTITY, this.gravity);
                }
 
                if(sf & 0x20)
@@ -58,11 +58,11 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
                        WriteByte(MSG_ENTITY, fr);
                }
 
-               WriteByte(MSG_ENTITY, self.realowner.team);
+               WriteByte(MSG_ENTITY, this.realowner.team);
        }
 
        if(sf & 2)
-               WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
+               WriteByte(MSG_ENTITY, this.csqcprojectile_type); // TODO maybe put this into sf?
 
        return true;
 }