From 61195895739d2918773577e27a8da9e9dd3c42e8 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 30 Dec 2024 22:35:53 +1000 Subject: [PATCH] Send the team number with the spawn event to ensure an accurate team colour --- qcsrc/client/main.qc | 3 +-- qcsrc/server/spawnpoints.qc | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index b426840ed..9b3cf34ce 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -876,12 +876,11 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new) { this.origin = ReadVector(); + int teamnum = ReadByte() - 1; int particlesAndOrSound = ReadByte(); if(is_new) { - float teamnum = entcs_GetTeam(entnum - 1); - if(autocvar_cl_spawn_event_particles && (particlesAndOrSound & BIT(0))) { switch(teamnum) diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 0a4ee0c2b..1633a7617 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -39,6 +39,7 @@ bool SpawnEvent_Send(entity this, entity to, int sf) { WriteByte(MSG_ENTITY, etof(this.owner)); WriteVector(MSG_ENTITY, this.owner.origin); + WriteByte(MSG_ENTITY, this.owner.team); WriteByte(MSG_ENTITY, autocvar_g_spawn_alloweffects); send = true; } -- 2.39.5