]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Cap the respawntime factor for overtime to prevent extrem respawn times
authorFreddy <schro.sb@gmail.com>
Wed, 13 Jul 2016 23:54:13 +0000 (01:54 +0200)
committerFreddy <schro.sb@gmail.com>
Wed, 13 Jul 2016 23:54:13 +0000 (01:54 +0200)
qcsrc/server/cl_player.qc

index 82af5b0727f794e485bcecff3bec50b5570cbf8b..f12af3c2065c81e948f986fbfb92f43527eb2e88 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "../common/animdecide.qh"
 
+#define RESPAWN_DELAY_OVERTIMEFACTOR_MAX 5
+
 void Drop_Special_Items(entity player)
 {
        // called when the player has become stuck or frozen
@@ -228,6 +230,8 @@ void calculate_player_respawn_time(entity this)
        if (checkrules_overtimesadded)
        {
                float delay_overtimefactor = pow(GAMETYPE_DEFAULTED_SETTING(respawn_delay_overtimefactor), checkrules_overtimesadded);
+               // cap the factor at a max value
+               delay_overtimefactor = min(delay_overtimefactor, RESPAWN_DELAY_OVERTIMEFACTOR_MAX);
                sdelay_small *= delay_overtimefactor;
                sdelay_large *= delay_overtimefactor;
                sdelay_max *= delay_overtimefactor;