]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/csqcprojectile.qc
Merge branch 'master' into terencehill/ft_autorevive_progress
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / csqcprojectile.qc
index 9fcfd34c205b712ee1ff716693cd18415a860dbc..07f6f5c6651bd1615b35761921119294ee0d8bcd 100644 (file)
@@ -1,12 +1,12 @@
 #include "csqcprojectile.qh"
 
-#include <common/t_items.qh>
-
-#include "../command/common.qh"
-
 #include <common/constants.qh>
 #include <common/net_linked.qh>
+#include <common/stats.qh>
+#include <common/weapons/_all.qh>
 #include <common/weapons/_all.qh>
+#include <server/command/common.qh>
+#include <server/items/items.qh>
 
 .float csqcprojectile_type;
 
@@ -40,15 +40,11 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
 
        if(sf & 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(sf & 0x80)
                {
-                       WriteCoord(MSG_ENTITY, this.velocity.x);
-                       WriteCoord(MSG_ENTITY, this.velocity.y);
-                       WriteCoord(MSG_ENTITY, this.velocity.z);
+                       WriteVector(MSG_ENTITY, this.velocity);
                        if(sf & 0x10)
                                WriteCoord(MSG_ENTITY, this.gravity);
                }
@@ -59,7 +55,10 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
                        WriteByte(MSG_ENTITY, fr);
                }
 
-               WriteByte(MSG_ENTITY, this.realowner.team);
+               if(teamplay)
+                       WriteByte(MSG_ENTITY, this.realowner.team);
+               else
+                       WriteByte(MSG_ENTITY, this.realowner.clientcolors); // NOTE: doesn't work on non-clients
        }
 
        if(sf & 2)
@@ -118,6 +117,10 @@ void UpdateCSQCProjectileAfterTeleport(entity e)
        {
                // send new origin data
                e.SendFlags |= 0x01;
+               // send full data as the projectile may need resetting
+               // this is a workaround for client-side projectiles erroneously calling their SUB_Stop touch function occasionally
+               // when passing through a warpzone
+               e.SendFlags |= 2;
                // mark as teleported
                e.SendFlags |= 0x08;
        }