]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix projectile colormap support
authorMario <mario@smbclan.net>
Fri, 31 Mar 2017 16:04:36 +0000 (02:04 +1000)
committerMario <mario@smbclan.net>
Fri, 31 Mar 2017 16:04:36 +0000 (02:04 +1000)
qcsrc/client/weapons/projectile.qc
qcsrc/server/weapons/csqcprojectile.qc

index 1f88bc8d60ae01519f0f13774d0f81191e35e279..9c8f518d79b8b7dd0a434766113ade611952ca32 100644 (file)
@@ -264,7 +264,23 @@ 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;
+               if(this.colormap > 0)
+                       this.glowmod = colormapPaletteColor(this.colormap & 0x0F, true) * 2;
+               else
+                       this.glowmod = '1 1 1';
        }
 
        if (f & 2)
index 9fcfd34c205b712ee1ff716693cd18415a860dbc..42bff7c0e9118de43506f95d0f796081cb2c0033 100644 (file)
@@ -59,7 +59,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)