From 001250c1f7d5600a59a92fc781fae4deeda12ce5 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Tue, 14 May 2013 13:52:48 -0400 Subject: [PATCH] Various fixes for spawnpoint effects --- qcsrc/client/Main.qc | 25 ++++++++++++++++--------- qcsrc/server/cl_client.qc | 2 +- qcsrc/server/spawnpoints.qc | 29 ++++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index f60ad9765f..930ea1b76d 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -704,12 +704,14 @@ void Spawn_Draw(void) void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint { float teamnum = (ReadByte() - 1); - self.origin_x = ReadShort(); - self.origin_y = ReadShort(); - self.origin_z = ReadShort(); + vector spn_origin; + spn_origin_x = ReadShort(); + spn_origin_y = ReadShort(); + spn_origin_z = ReadShort(); if(is_new) { + self.origin = spn_origin; setsize(self, PL_MIN, PL_MAX); droptofloor(); @@ -725,14 +727,19 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint }*/ if(autocvar_cl_spawn_point_particles) { - switch(teamnum) + if(teamplay) { - case NUM_TEAM_1: self.cnt = particleeffectnum("spawn_point_red"); break; - case NUM_TEAM_2: self.cnt = particleeffectnum("spawn_point_blue"); break; - case NUM_TEAM_3: self.cnt = particleeffectnum("spawn_point_yellow"); break; - case NUM_TEAM_4: self.cnt = particleeffectnum("spawn_point_pink"); break; - default: self.cnt = particleeffectnum("spawn_point_neutral"); break; + switch(teamnum) + { + case NUM_TEAM_1: self.cnt = particleeffectnum("spawn_point_red"); break; + case NUM_TEAM_2: self.cnt = particleeffectnum("spawn_point_blue"); break; + case NUM_TEAM_3: self.cnt = particleeffectnum("spawn_point_yellow"); break; + case NUM_TEAM_4: self.cnt = particleeffectnum("spawn_point_pink"); break; + default: self.cnt = particleeffectnum("spawn_point_neutral"); break; + } } + else { self.cnt = particleeffectnum("spawn_point_neutral"); } + self.draw = Spawn_Draw; } } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 9239a82920..c86ced02e1 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -511,7 +511,7 @@ void PutClientInServer (void) entity spawnevent = spawn(); spawnevent.owner = self; - Net_LinkEntity(spawnevent, FALSE, 1, SpawnEvent_Send); + Net_LinkEntity(spawnevent, FALSE, 0.5, SpawnEvent_Send); self.model = ""; FixPlayermodel(); diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 7d402ad838..429bf84947 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -100,7 +100,34 @@ void relocate_spawnpoint() e.solid = SOLID_TRIGGER; } - Net_LinkEntity(self, FALSE, 0, SpawnPoint_Send); + // Don't show team spawns in non-team matches, + // and don't show non-team spawns in team matches. + // (Unless useallspawns is activated) + if( + !( + ( // if this passes, there is a DM spawn on a team match + teamplay + && (self.team != NUM_TEAM_1) + && (self.team != NUM_TEAM_2) + && (self.team != NUM_TEAM_3) + && (self.team != NUM_TEAM_4) + ) + || + ( // if this passes, there is a team spawn on a DM match + !teamplay + && + ( + (self.team == NUM_TEAM_1) + || (self.team == NUM_TEAM_2) + || (self.team == NUM_TEAM_3) + || (self.team == NUM_TEAM_4) + ) + ) + ) + || + autocvar_g_spawn_useallspawns + ) + { Net_LinkEntity(self, FALSE, 0, SpawnPoint_Send); } } void spawnfunc_info_player_survivor (void) -- 2.39.2