From: Mario Date: Mon, 30 Dec 2024 12:35:53 +0000 (+1000) Subject: Send the team number with the spawn event to ensure an accurate team colour X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=61195895739d2918773577e27a8da9e9dd3c42e8;p=xonotic%2Fxonotic-data.pk3dir.git Send the team number with the spawn event to ensure an accurate team colour --- 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; }