]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Send the team number with the spawn event to ensure an accurate team colour
authorMario <mario.mario@y7mail.com>
Mon, 30 Dec 2024 12:35:53 +0000 (22:35 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 30 Dec 2024 12:35:53 +0000 (22:35 +1000)
qcsrc/client/main.qc
qcsrc/server/spawnpoints.qc

index b426840edb393a73517d82e13a72f849059aa721..9b3cf34ce6a3364ba97a1b070c1c41a08ba4bb2e 100644 (file)
@@ -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)
index 0a4ee0c2b46e840865b01f68c6899dd9b5e658ff..1633a7617f4ad778edacdae26f3e10f66008c6b8 100644 (file)
@@ -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;
        }