]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
allow only 5 suicides every 5 seconds in CTS. No killmessage (centerprint) needed...
authorFruitieX <fruitiex@gmail.com>
Sat, 11 Dec 2010 18:57:03 +0000 (20:57 +0200)
committerFruitieX <fruitiex@gmail.com>
Sat, 11 Dec 2010 18:57:03 +0000 (20:57 +0200)
defaultXonotic.cfg
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc

index f591fe31f9684d86facd08f53bc8ce49a8afc195..e5a78a0a0b5ebb8e6b2720d5851fd8f39effc143 100644 (file)
@@ -623,7 +623,7 @@ set g_ons_respawn_waves 0
 set g_rc_respawn_waves 0
 set g_rc_respawn_delay 0
 set g_cts_respawn_waves 0
-set g_cts_respawn_delay 0.25
+set g_cts_respawn_delay 0
 set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts"
 set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible"
 set g_freezetag_respawn_waves 0
index c1005d0036b9cd18f67eb3598956a4dd80a5fc23..a19aba97f9e2d5ff7bea5203625e64c04a8d5c12 100644 (file)
@@ -1304,7 +1304,11 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
 
     if(g_cts) // allow an instant kill in CTS
     {
-        ClientKill_Now();
+        if(self.killcnt < 5) // 5 kills in 5 seconds allowed
+        {
+            self.killcnt += 1;
+            ClientKill_Now();
+        }
         return;
     }
 
@@ -2873,6 +2877,9 @@ void PlayerPreThink (void)
                if(g_nexball)
                        nexball_setstatus();
 
+        if(g_cts)
+            self.killcnt = max(0, self.killcount - sys_frametime);
+
                self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
 
                //self.angles_y=self.v_angle_y + 90;   // temp
index 27bd209c501ca6d799f48ec6e13f822b6e7eee86..9fa4784faca6cd6022dfcf24628dd32a8ce14f86 100644 (file)
@@ -669,7 +669,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                waves = 0;
                sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay"));
                if(!sdelay)
-                       sdelay = autocvar_g_respawn_delay;
+        {
+            if(g_cts)
+                sdelay = 0; // no respawn delay in CTS
+            else
+                sdelay = autocvar_g_respawn_delay;
+        }
                waves = cvar(strcat("g_", GetGametype(), "_respawn_waves"));
                if(!waves)
                        waves = autocvar_g_respawn_waves;
index 76ce748ca8d93ec1d163d8431a4f4b10f53957ea..d46cca686c051fd24b0e14705f29961cbf9067bb 100644 (file)
@@ -659,3 +659,5 @@ float serverflags;
 .float freezetag_frozen;
 .float freezetag_beginrevive_time;
 .float freezetag_revive_progress;
+
+.float killcnt; // keep track of how many times a player has suicided during the previous 5 seconds
index f064e53593fbb65ef03a7e62b180c68499d88ab8..6ab29006d2226bc8fa897b446aa05a4f8de6c262 100644 (file)
@@ -295,7 +295,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                {
                        if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
                                msg = ColoredTeamName(targ.team); // TODO: check if needed?
-                       Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
+            if(!g_cts) // no "killed your own dumb self" message in CTS
+                Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
 
                        if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
                        {