]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Merge branch 'master' of git://git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index ba6c2e5781486f7e037c3c21e0a0b7e2b0d5bbac..12c810f16c7d43fcfbe55f644b5b5c5528785cff 100644 (file)
@@ -724,15 +724,6 @@ void PutObserverInServer (void)
                self.frags = FRAGS_SPECTATOR;
 }
 
-float RestrictSkin(float s)
-{
-       if(!teams_matter)
-               return s;
-       if(s == 6)
-               return 6;
-       return mod(s, 3);
-}
-
 void FixPlayermodel()
 {
        local string defaultmodel;
@@ -794,7 +785,7 @@ void FixPlayermodel()
                }
 
                oldskin = self.skinindex;
-               self.skinindex = RestrictSkin(stof(self.playerskin));
+               self.skinindex = stof(self.playerskin);
        }
 
        if(chmdl || oldskin != self.skinindex)
@@ -1244,18 +1235,16 @@ void ClientKill_Now_TeamChange()
 
 void ClientKill_Now()
 {
+       remove(self.killindicator);
+       self.killindicator = world;
+
        if(self.killindicator_teamchange)
                ClientKill_Now_TeamChange();
 
        // in any case:
        Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
 
-       if(self.killindicator)
-       {
-               dprint("Cleaned up after a leaked kill indicator.\n");
-               remove(self.killindicator);
-               self.killindicator = world;
-       }
+       // now I am sure the player IS dead
 }
 void KillIndicator_Think()
 {
@@ -1311,6 +1300,15 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
        if(g_race_qualifying || g_cts)
                killtime = 0;
 
+    if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
+    {
+               remove(self.killindicator);
+               self.killindicator = world;
+
+        ClientKill_Now(); // allow instant kill in this case
+        return;
+    }
+
        self.killindicator_teamchange = targetteam;
 
     if(!self.killindicator)
@@ -1381,7 +1379,7 @@ void ClientKill (void)
                ClientKill_TeamChange(0);
 }
 
-void CTS_ClientKill (entity e) // silent version of ClientKill
+void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
 {
     e.killindicator = spawn();
     e.killindicator.owner = e;