if (!(frametime && IS_PLAYER(player)))
return true;
- entity reviving_players_last = NULL;
- entity reviving_players_first = NULL;
+ entity revivers_last = NULL;
+ entity revivers_first = NULL;
bool player_is_reviving = false;
int n = 0;
it.freezetag_revive_time -= 1;
}
}
- if (reviving_players_last)
- reviving_players_last.chain = it;
- reviving_players_last = it;
- if (!reviving_players_first)
- reviving_players_first = it;
+ if (revivers_last)
+ revivers_last.chain = it;
+ revivers_last = it;
+ if (!revivers_first)
+ revivers_first = it;
++n;
});
- if (reviving_players_last)
- reviving_players_last.chain = NULL;
+ if (revivers_last)
+ revivers_last.chain = NULL;
// allow normal revival during automatic revival
// (if we wouldn't allow it then freezetag_frozen_timeout should be checked too in the previous loop)
}
// 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);
nades_GiveBonus(it, autocvar_g_nades_bonus_score_low);
}
- entity first = reviving_players_first;
- Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname);
- Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, first.netname);
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
+ Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
if(autocvar_sv_eventlog)
{
string revivers = "";
- for(entity it = reviving_players_first; it; it = it.chain)
+ for(entity it = revivers_first; it; it = it.chain)
revivers = strcat(revivers, ftos(it.playerid), ",");
revivers = substring(revivers, 0, strlen(revivers) - 1);
GameLogEcho(strcat(":ft:revival:", ftos(player.playerid), ":", revivers));
}
}
- for(entity it = reviving_players_first; it; it = it.chain)
+ for(entity it = revivers_first; it; it = it.chain)
STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
}
{
int n = 0;
- entity reviving_players_last = NULL;
- entity reviving_players_first = NULL;
+ entity revivers_last = NULL;
+ entity revivers_first = NULL;
if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout)
n = -1;
FOREACH_CLIENT(IS_PLAYER(it) && IN_REVIVING_RANGE(player, it, revive_extra_size), {
if (STAT(FROZEN, it))
continue;
- if (reviving_players_last)
- reviving_players_last.chain = it;
- reviving_players_last = it;
- if (!reviving_players_first)
- reviving_players_first = it;
+ if (revivers_last)
+ revivers_last.chain = it;
+ revivers_last = it;
+ if (!revivers_first)
+ revivers_first = it;
++n;
});
- if (reviving_players_last)
- reviving_players_last.chain = NULL;
+ if (revivers_last)
+ revivers_last.chain = NULL;
}
if (n > 0 && STAT(FROZEN, player) == FROZEN_TEMP_DYING) // OK, there is at least one teammate reviving us
{
Unfreeze(player, false);
- entity first = reviving_players_first;
- Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname);
- Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
+ Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
}
- for(entity it = reviving_players_first; it; it = it.chain)
+ for(entity it = revivers_first; it; it = it.chain)
STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
}
}