From: Mario <mario.mario@y7mail.com>
Date: Fri, 24 Jan 2025 13:12:46 +0000 (+1000)
Subject: Set the player's team to 0 in non-teamplay gamemodes
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86fc22654298e917698c61d28ffe3c682b3bf49c;p=xonotic%2Fxonotic-data.pk3dir.git

Set the player's team to 0 in non-teamplay gamemodes
---

diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc
index dfd9c35f5..0ad653c6f 100644
--- a/qcsrc/client/weapons/projectile.qc
+++ b/qcsrc/client/weapons/projectile.qc
@@ -299,10 +299,10 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
 		}
 
 		int proj_team = ReadByte();
-		this.team = proj_team - 1;
 
 		if(teamplay)
 		{
+			this.team = proj_team - 1;
 			if(proj_team)
 				this.colormap = (this.team) * 0x11; // note: team - 1 on server (client uses different numbers)
 			else
@@ -310,7 +310,10 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
 			this.colormap |= BIT(10); // RENDER_COLORMAPPED
 		}
 		else
+		{
+			this.team = 0;
 			this.colormap = proj_team;
+		}
 		// TODO: projectiles use glowmaps for their color, not teams
 		#if 0
 		if(this.colormap > 0)
diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc
index f9da5a2d4..c442a78d6 100644
--- a/qcsrc/server/teamplay.qc
+++ b/qcsrc/server/teamplay.qc
@@ -162,7 +162,10 @@ void setcolor(entity this, int clr)
 {
 #if 1
 	this.clientcolors = clr;
-	this.team = (clr & 15) + 1;
+	if(teamplay)
+		this.team = (clr & 15) + 1;
+	else
+		this.team = 0;
 #else
 	builtin_setcolor(this, clr);
 #endif