]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/ft_autorevive_progress
authorterencehill <piuntn@gmail.com>
Fri, 12 Jun 2020 20:12:04 +0000 (22:12 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 12 Jun 2020 20:12:04 +0000 (22:12 +0200)
1  2 
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh
qcsrc/server/g_damage.qc
qcsrc/server/player.qc

Simple merge
index 8e9f06a099d32ae4fac91292c0a889d013594530,360dc7a4ea8bb1f15ca4274c6ad2225a9625cf75..2a931fa975f8931b7b6759e5b7a4500033e93d91
@@@ -506,32 -486,24 +511,32 @@@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink
        entity reviving_players_last = NULL;
        entity reviving_players_first = NULL;
  
-       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;
  
 +      float base_progress = 0;
 +      if  (STAT(FROZEN, player) == FROZEN_NORMAL && autocvar_g_freezetag_revive_auto
 +              && autocvar_g_freezetag_frozen_maxtime > 0 && autocvar_g_freezetag_revive_auto_progress)
 +      {
 +              // NOTE if auto-revival is in progress, manual revive speed is reduced so that it always takes the same amount of time
 +              base_progress = bound(0, (1 - (player.freezetag_frozen_timeout - time) / autocvar_g_freezetag_frozen_maxtime), 1);
 +      }
 +
        if (!n) // no teammate nearby
        {
                if (STAT(FROZEN, player) == FROZEN_NORMAL)
Simple merge
Simple merge