From 29ee514d194946b472a1901e0d26d50d48d429b8 Mon Sep 17 00:00:00 2001 From: Freddy Date: Thu, 14 Jul 2016 01:54:13 +0200 Subject: [PATCH] Cap the respawntime factor for overtime to prevent extrem respawn times --- qcsrc/server/cl_player.qc | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.2