]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/csqcprojectile.qc
Merge branch 'master' into morphed/hagar
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / csqcprojectile.qc
index 133e92d3fc9e529cdbe990dea1e7ee2154c749fa..f3e9f22ef6859a2b8e538a39e6b14be0b602c92f 100644 (file)
@@ -1,19 +1,15 @@
-#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
+#include "csqcprojectile.qh"
+
+#include <common/t_items.qh>
+
+#include "../command/common.qh"
+
+#include <common/constants.qh>
+#include <common/weapons/all.qh>
 
 .float csqcprojectile_type;
 
-bool CSQCProjectile_SendEntity(entity to, int sf)
+bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
 {
        float ft, fr;
 
@@ -23,7 +19,7 @@ bool CSQCProjectile_SendEntity(entity to, int sf)
        if(self.csqcprojectile_clientanimate)
                sf |= 0x80; // client animated, not interpolated
 
-       if(self.flags & FL_ONGROUND)
+       if(IS_ONGROUND(self))
                sf |= 0x40;
 
        ft = fr = 0;
@@ -38,7 +34,7 @@ bool CSQCProjectile_SendEntity(entity to, int sf)
        if(self.gravity != 0)
                sf |= 0x10;
 
-       WriteByte(MSG_ENTITY, ENT_CLIENT_PROJECTILE);
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_PROJECTILE);
        WriteByte(MSG_ENTITY, sf);
 
        if(sf & 1)
@@ -75,7 +71,7 @@ bool CSQCProjectile_SendEntity(entity to, int sf)
 void CSQCProjectile_Check(entity e)
 {
        if(e.csqcprojectile_clientanimate)
-       if(e.flags & FL_ONGROUND)
+       if(IS_ONGROUND(e))
        if(e.origin != e.csqcprojectile_oldorigin)
                UpdateCSQCProjectile(e);
        e.csqcprojectile_oldorigin = e.origin;
@@ -102,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, int 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);
        }
@@ -117,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;