]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/csqcprojectile.qc
Rename defs to qh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / csqcprojectile.qc
index 3554f1ff67235142f837507183b772c41c841c09..bc7413033b0b4ed08cd78c1bd0700207bf7e3d8b 100644 (file)
@@ -1,3 +1,16 @@
+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+       #include "../../dpdefs/progsdefs.qh"
+    #include "../../common/constants.qh"
+    #include "../../common/weapons/weapons.qh"
+    #include "csqcprojectile.qh"
+    #include "../t_items.qh"
+    #include "../constants.qh"
+    #include "../defs.qh"
+    #include "../command/common.qh"
+#endif
+
 .float csqcprojectile_type;
 
 float CSQCProjectile_SendEntity(entity to, float sf)
@@ -30,15 +43,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);
                }
@@ -48,11 +61,13 @@ float CSQCProjectile_SendEntity(entity to, float sf)
                        WriteByte(MSG_ENTITY, ft);
                        WriteByte(MSG_ENTITY, fr);
                }
+
+               WriteByte(MSG_ENTITY, self.realowner.team);
        }
 
        if(sf & 2)
                WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
-       
+
        return 1;
 }
 
@@ -69,9 +84,9 @@ void CSQCProjectile_Check(entity e)
 void CSQCProjectile(entity e, float clientanimate, float type, float docull)
 {
        Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
-       
+
        e.csqcprojectile_clientanimate = clientanimate;
-       
+
        if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE)
        {
                if(e.gravity == 0)
@@ -92,6 +107,12 @@ void UpdateCSQCProjectile(entity e)
                // send new origin data
                e.SendFlags |= 0x01;
        }
+// FIXME HACK
+       else if(e.SendEntity == ItemSend)
+       {
+               ItemUpdate(e);
+       }
+// END HACK
 }
 
 void UpdateCSQCProjectileAfterTeleport(entity e)