Merge branch 'Mario/cts_respawn_clear' into 'master'
authorMario <zacjardine@y7mail.com>
Tue, 16 May 2017 22:15:33 +0000 (22:15 +0000)
committerMario <zacjardine@y7mail.com>
Tue, 16 May 2017 22:15:33 +0000 (22:15 +0000)
Merge branch Mario/cts_respawn_clear (S merge request)

See merge request !432

1  2 
qcsrc/server/client.qc
qcsrc/server/player.qc

diff --combined qcsrc/server/client.qc
index 95f28752714a9c322ebfb08ba67cf0ffbcb930e6,aad1629fcb2af38b9d9b71b7ebd4ba2ffc2679df..d705fd63abc7e087d701bf448c12e0ed8485cdab
@@@ -338,7 -338,6 +338,7 @@@ void PutObserverInServer(entity this
  
        this.items = 0;
        this.weapons = '0 0 0';
 +      this.dual_weapons = '0 0 0';
        this.drawonlytoclient = this;
  
        this.weaponmodel = "";
@@@ -573,8 -572,6 +573,8 @@@ void PutClientInServer(entity this
                }
                SetSpectatee_status(this, 0);
  
 +              this.dual_weapons = '0 0 0';
 +
                this.superweapons_finished = (this.weapons & WEPSET_SUPERWEAPONS) ? time + autocvar_g_balance_superweapons_time : 0;
  
                this.items = start_items;
@@@ -910,7 -907,7 +910,7 @@@ void KillIndicator_Think(entity this
                ClientKill_Now(this.owner);
                return;
        }
-     else if(g_cts && this.health == 1) // health == 1 means that it's silent
+     else if(this.health == 1) // health == 1 means that it's silent
      {
          this.nextthink = time + 1;
          this.cnt -= 1;
@@@ -940,11 -937,9 +940,9 @@@ void ClientKill_TeamChange (entity this
  
        killtime = autocvar_g_balance_kill_delay;
  
-       if(g_race_qualifying || g_cts)
-               killtime = 0;
      if(MUTATOR_CALLHOOK(ClientKill, this, killtime))
        return;
+     killtime = M_ARGV(1, float);
  
        this.killindicator_teamchange = targetteam;
  
@@@ -1443,8 -1438,7 +1441,8 @@@ void player_powerups(entity this
                        if (time < this.strength_finished)
                        {
                                this.items = this.items | ITEM_Strength.m_itemid;
 -                              Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname);
 +                              if(!g_cts)
 +                                      Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname);
                                Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_STRENGTH);
                        }
                }
                        if (time < this.invincible_finished)
                        {
                                this.items = this.items | ITEM_Shield.m_itemid;
 -                              Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SHIELD, this.netname);
 +                              if(!g_cts)
 +                                      Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SHIELD, this.netname);
                                Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_SHIELD);
                        }
                }
                        if (time < this.superweapons_finished || (this.items & IT_UNLIMITED_SUPERWEAPONS))
                        {
                                this.items = this.items | IT_SUPERWEAPON;
 -                              Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
 +                              if(!g_cts)
 +                                      Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
                                Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
                        }
                        else
@@@ -1700,7 -1692,6 +1698,7 @@@ void SpectateCopy(entity this, entity s
        this.superweapons_finished = spectatee.superweapons_finished;
        STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee);
        this.weapons = spectatee.weapons;
 +      this.dual_weapons = spectatee.dual_weapons;
        this.vortex_charge = spectatee.vortex_charge;
        this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
        this.hagar_load = spectatee.hagar_load;
@@@ -1813,9 -1804,6 +1811,9 @@@ void SetSpectatee_status(entity this, i
  
  void SetSpectatee(entity this, entity spectatee)
  {
 +      if(IS_BOT_CLIENT(this))
 +              return; // bots abuse .enemy, this code is useless to them
 +
        entity old_spectatee = this.enemy;
  
        this.enemy = spectatee;
@@@ -1956,7 -1944,6 +1954,7 @@@ void Join(entity this
  
        PutClientInServer(this);
  
 +      if(IS_PLAYER(this))
        if(teamplay && this.team != -1)
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_PLAY_TEAM), this.netname);
        else
diff --combined qcsrc/server/player.qc
index f22ff0daf8f5d1617fcda9cb121e96466c475857,8598bc095e76871416d0b535c7667185e09ad080..faa3c810137a4628ae82b585d43cdcbd1def147c
@@@ -253,7 -253,7 +253,7 @@@ void calculate_player_respawn_time(enti
                ));
                if (sdelay_small_count == 0)
                {
-                       if (g_cts)
+                       if (IS_INDEPENDENT_PLAYER(this))
                        {
                                // Players play independently. No point in requiring enemies.
                                sdelay_small_count = 1;
                }
                if (sdelay_large_count == 0)
                {
-                       if (g_cts)
+                       if (IS_INDEPENDENT_PLAYER(this))
                        {
                                // Players play independently. No point in requiring enemies.
                                sdelay_large_count = 1;
@@@ -658,7 -658,6 +658,7 @@@ void PlayerDamage(entity this, entity i
                                ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0;
                        }
                ));
 +              MUTATOR_CALLHOOK(PlayerDied, this);
        }
  }
  
@@@ -685,48 -684,6 +685,48 @@@ void PrintToChat(entity player, string 
        sprint(player, text);
  }
  
 +void DebugPrintToChat(entity player, string text)
 +{
 +      if (autocvar_developer)
 +      {
 +              PrintToChat(player, text);
 +      }
 +}
 +
 +void PrintToChatAll(string text)
 +{
 +      text = strcat("\{1}^7", text, "\n");
 +      bprint(text);
 +}
 +
 +void DebugPrintToChatAll(string text)
 +{
 +      if (autocvar_developer)
 +      {
 +              PrintToChatAll(text);
 +      }
 +}
 +
 +void PrintToChatTeam(int teamnum, string text)
 +{
 +      text = strcat("\{1}^7", text, "\n");
 +      FOREACH_CLIENT(IS_REAL_CLIENT(it),
 +      {
 +              if (it.team == teamnum)
 +              {
 +                      sprint(it, text);
 +              }
 +      });
 +}
 +
 +void DebugPrintToChatTeam(int teamnum, string text)
 +{
 +      if (autocvar_developer)
 +      {
 +              PrintToChatTeam(teamnum, text);
 +      }
 +}
 +
  /**
   * message "": do not say, just test flood control
   * return value: