From: Freddy Date: Wed, 13 Jul 2016 23:54:13 +0000 (+0200) Subject: Cap the respawntime factor for overtime to prevent extrem respawn times X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=29ee514d194946b472a1901e0d26d50d48d429b8;p=xonotic%2Fxonotic-data.pk3dir.git Cap the respawntime factor for overtime to prevent extrem respawn times --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 82af5b072..f12af3c20 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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;