From: terencehill Date: Sat, 30 May 2020 14:24:23 +0000 (+0200) Subject: Allow normal revival during automatic revival. It fixes issues with the revive progre... X-Git-Tag: xonotic-v0.8.5~990 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=e4bd23b8f18d393684f15eb0ef2ab8571c772454;ds=sidebyside Allow normal revival during automatic revival. It fixes issues with the revive progress indicator --- diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 5b4c80e7f6..360dc7a4ea 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -486,24 +486,23 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) entity reviving_players_last = NULL; entity reviving_players_first = NULL; - int n; - if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout) - n = -1; - else - { - n = 0; - vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size; - FOREACH_CLIENT(IS_PLAYER(it) && IS_REVIVING(player, it, revive_extra_size), { - if (reviving_players_last) - reviving_players_last.chain = it; - reviving_players_last = it; - if (!reviving_players_first) - reviving_players_first = it; - ++n; - }); + int n = 0; + vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size; + FOREACH_CLIENT(IS_PLAYER(it) && IS_REVIVING(player, it, revive_extra_size), { if (reviving_players_last) - reviving_players_last.chain = NULL; - } + reviving_players_last.chain = it; + reviving_players_last = it; + if (!reviving_players_first) + reviving_players_first = it; + ++n; + }); + if (reviving_players_last) + reviving_players_last.chain = NULL; + + // allow normal revival during automatic revival + // (not allowing it IS_REVIVING should check freezetag_frozen_timeout too) + if (!n && player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout) + n = -1; if (!n) // no teammate nearby {