]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/csqcprojectile.qc
Merge branch 'master' into martin-t/mg-solidpen
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / csqcprojectile.qc
index 7e7478e9b8ea8aedd9e71f0b49f839084849bf93..5352b40cde1a8fa1afb3b6058d36a48a3ea0b6cf 100644 (file)
@@ -1,11 +1,14 @@
 #include "csqcprojectile.qh"
 
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
 #include <common/t_items.qh>
 
 #include "../command/common.qh"
 
 #include <common/constants.qh>
-#include <common/weapons/all.qh>
+#include <common/net_linked.qh>
+#include <common/weapons/_all.qh>
 
 .float csqcprojectile_type;
 
@@ -39,15 +42,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);
                }
@@ -58,7 +57,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)
@@ -83,7 +85,7 @@ void CSQCProjectile(entity e, float clientanimate, int type, float docull)
 
        e.csqcprojectile_clientanimate = clientanimate;
 
-       if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE)
+       if(e.move_movetype == MOVETYPE_TOSS || e.move_movetype == MOVETYPE_BOUNCE)
        {
                if(e.gravity == 0)
                        e.gravity = 1;