]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Various fixes for spawnpoint effects
authorSamual Lenks <samual@xonotic.org>
Tue, 14 May 2013 17:52:48 +0000 (13:52 -0400)
committerSamual Lenks <samual@xonotic.org>
Tue, 14 May 2013 17:52:48 +0000 (13:52 -0400)
qcsrc/client/Main.qc
qcsrc/server/cl_client.qc
qcsrc/server/spawnpoints.qc

index f60ad9765f44dd684658e5da923267d961582fc7..930ea1b76d1be99eee2b0ac94f7b8eac3c221b33 100644 (file)
@@ -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;
                }
        }
index 9239a829202a7b910d8e9a851bee4f01e1f8c583..c86ced02e1f327dccf5fcefcb957d4c8489f056e 100644 (file)
@@ -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();
index 7d402ad838578300ac8e47fd2e1f628086615d3a..429bf84947e39fb0c652dabfff4e35c06f89f64b 100644 (file)
@@ -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)