- 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;
+ FOREACH_CLIENT(IS_PLAYER(it), {
+ // check if player is reviving anyone
+ if (STAT(FROZEN, it) == FROZEN_NORMAL)
+ {
+ if ((STAT(FROZEN, player) == FROZEN_NORMAL))
+ continue;
+ if (!IN_REVIVING_RANGE(player, it, revive_extra_size))
+ continue;
+ player_is_reviving = true;
+ break;
+ }
+
+ if (!(STAT(FROZEN, player) == FROZEN_NORMAL))
+ continue; // both player and it are NOT frozen
+ if (!IN_REVIVING_RANGE(player, it, revive_extra_size))
+ continue;
+
+ // found a teammate that is reviving player
+ if (autocvar_g_freezetag_revive_time_to_score > 0 && STAT(FROZEN, player) == FROZEN_NORMAL)
+ {
+ it.freezetag_revive_time += frametime / autocvar_g_freezetag_revive_time_to_score;
+ while (it.freezetag_revive_time > 1)
+ {
+ GameRules_scoring_add(it, SCORE, +1);
+ it.freezetag_revive_time -= 1;
+ }
+ }
+ if (revivers_last)
+ revivers_last.chain = it;
+ revivers_last = it;
+ if (!revivers_first)
+ revivers_first = it;