]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/freezetag_updates
authorterencehill <piuntn@gmail.com>
Wed, 21 Apr 2021 08:39:44 +0000 (10:39 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 21 Apr 2021 08:39:44 +0000 (10:39 +0200)
# Conflicts:
# qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc

1  2 
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc

index 9bba0b3e5414e891c48b9b05c8d9dd867da742a6,54fac9a5ab0a70a8eb5d4ea57082b3a6719e0015..8f6b800a354aa916555be9cb69db9eed0df00147
@@@ -583,24 -571,11 +601,24 @@@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink
        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);
                        }