]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/weapons/projectile.qc
Fix projectile glowmod support
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / weapons / projectile.qc
index 6d58ac77a2d1a01f72688513ecc2708750d93622..f31bef7a37bcb166f3840188d82b69835d1d67f0 100644 (file)
@@ -6,6 +6,7 @@
 #include "../mutators/events.qh"
 
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/physics/movetypes/movetypes.qh>
 
 #include <lib/csqcmodel/interpolate.qh>
@@ -263,7 +264,26 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                        this.fade_rate = 0;
                }
 
-               this.team = ReadByte() - 1;
+               int myteam = ReadByte();
+               this.team = myteam - 1;
+
+               if(teamplay)
+               {
+                       if(myteam)
+                               this.colormap = (this.team) * 0x11; // note: team - 1 on server (client uses different numbers)
+                       else
+                               this.colormap = 0x00;
+                       this.colormap |= BIT(10); // RENDER_COLORMAPPED
+               }
+               else
+                       this.colormap = myteam;
+               // TODO: projectiles use glowmaps for their color, not teams
+               #if 0
+               if(this.colormap > 0)
+                       this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true) * 2;
+               else
+                       this.glowmod = '1 1 1';
+               #endif
        }
 
        if (f & 2)