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
{