From: terencehill Date: Sun, 11 Apr 2021 20:18:38 +0000 (+0200) Subject: Rename reviving_players* variables to revivers* (less ambigous) X-Git-Tag: xonotic-v0.8.5~449^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fb1aa1d1d4d68123757d990a5097384d2291c1ef;p=xonotic%2Fxonotic-data.pk3dir.git Rename reviving_players* variables to revivers* (less ambigous) --- diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 249c343d3..54fac9a5a 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -511,8 +511,8 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) 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; @@ -544,15 +544,15 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) 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) @@ -599,28 +599,27 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) } // 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); } diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 050e4dbc5..bebb92f5c 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -1345,8 +1345,8 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink) { 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; @@ -1357,15 +1357,15 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink) 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 @@ -1377,12 +1377,11 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink) { 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); } }