From 890e8c36ab01ca786c5bbcad7b0c9a454d022774 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 1 Apr 2017 02:04:36 +1000 Subject: [PATCH] Fix projectile colormap support --- qcsrc/client/weapons/projectile.qc | 18 +++++++++++++++++- qcsrc/server/weapons/csqcprojectile.qc | 5 ++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 1f88bc8d6..9c8f518d7 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -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) diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index 9fcfd34c2..42bff7c0e 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -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) -- 2.39.2