]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/csqcprojectile.qc
Merge branch 'master' into terencehill/hud_cleanups
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / csqcprojectile.qc
index 3dd93c0581a3433a4a16a37bfb75f5438f7a253b..1e254b804e13e2b2c28bc73db985d237ba733a79 100644 (file)
@@ -1,6 +1,15 @@
+#include "csqcprojectile.qh"
+
+#include "../t_items.qh"
+
+#include "../command/common.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/weapons/all.qh"
+
 .float csqcprojectile_type;
 
-float CSQCProjectile_SendEntity(entity to, float sf)
+bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
 {
        float ft, fr;
 
@@ -30,15 +39,15 @@ float CSQCProjectile_SendEntity(entity to, float 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, self.origin.x);
+               WriteCoord(MSG_ENTITY, self.origin.y);
+               WriteCoord(MSG_ENTITY, self.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, self.velocity.x);
+                       WriteCoord(MSG_ENTITY, self.velocity.y);
+                       WriteCoord(MSG_ENTITY, self.velocity.z);
                        if(sf & 0x10)
                                WriteCoord(MSG_ENTITY, self.gravity);
                }
@@ -55,7 +64,7 @@ float CSQCProjectile_SendEntity(entity to, float sf)
        if(sf & 2)
                WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
 
-       return 1;
+       return true;
 }
 
 .vector csqcprojectile_oldorigin;
@@ -68,7 +77,7 @@ void CSQCProjectile_Check(entity e)
        e.csqcprojectile_oldorigin = e.origin;
 }
 
-void CSQCProjectile(entity e, float clientanimate, float type, float docull)
+void CSQCProjectile(entity e, float clientanimate, int type, float docull)
 {
        Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
 
@@ -89,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, float type, float docull)
 
 void UpdateCSQCProjectile(entity e)
 {
-       if(e.SendEntity == CSQCProjectile_SendEntity)
+       if(e.SendEntity3 == CSQCProjectile_SendEntity)
        {
                // send new origin data
                e.SendFlags |= 0x01;
        }
 // FIXME HACK
-       else if(e.SendEntity == ItemSend)
+       else if(e.SendEntity3 == ItemSend)
        {
                ItemUpdate(e);
        }
@@ -104,7 +113,7 @@ void UpdateCSQCProjectile(entity e)
 
 void UpdateCSQCProjectileAfterTeleport(entity e)
 {
-       if(e.SendEntity == CSQCProjectile_SendEntity)
+       if(e.SendEntity3 == CSQCProjectile_SendEntity)
        {
                // send new origin data
                e.SendFlags |= 0x01;