if (!n) // no teammate nearby
{
float clearspeed = autocvar_g_freezetag_revive_clearspeed;
- if (autocvar_g_freezetag_revive_time_to_score > 0)
- clearspeed = 0; // prevent stacking points by entering and exiting the revival zone many times
if (STAT(FROZEN, player) == FROZEN_NORMAL)
- STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * clearspeed * (1 - base_progress), 1);
+ {
+ if (autocvar_g_freezetag_revive_time_to_score > 0)
+ {
+ if (STAT(REVIVE_PROGRESS, player) > base_progress)
+ {
+ // reduce auto-revival time based on manual revival progress
+ base_progress = STAT(REVIVE_PROGRESS, player);
+ player.freezetag_frozen_timeout = time + autocvar_g_freezetag_frozen_maxtime * (1 - STAT(REVIVE_PROGRESS, player));
+ }
+ // don't clear revive progress, it would allow stacking points
+ // by entering and exiting the revival zone many times
+ STAT(REVIVE_PROGRESS, player) = base_progress;
+ }
+ else
+ STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * clearspeed * (1 - base_progress), 1);
+ }
- else if (!STAT(FROZEN, player))
+ else if (!STAT(FROZEN, player) && !player_is_reviving)
STAT(REVIVE_PROGRESS, player) = base_progress; // thawing nobody
}
else if (STAT(FROZEN, player) == FROZEN_NORMAL) // OK, there is at least one teammate reviving us
}
// EVERY team mate nearby gets a point (even if multiple!)
- for(entity it = reviving_players_first; it; it = it.chain)
+ for(entity it = revivers_first; it; it = it.chain)
{
GameRules_scoring_add(it, FREEZETAG_REVIVALS, +1);
- GameRules_scoring_add(it, SCORE, +1);
+ if (autocvar_g_freezetag_revive_time_to_score <= 0)
+ GameRules_scoring_add(it, SCORE, +1);
nades_GiveBonus(it, autocvar_g_nades_bonus_score_low);
}