Merge branch 'master' into Mario/cts_respawn_clear
authorMario <mario@smbclan.net>
Tue, 4 Apr 2017 21:22:54 +0000 (07:22 +1000)
committerMario <mario@smbclan.net>
Tue, 4 Apr 2017 21:22:54 +0000 (07:22 +1000)
1  2 
qcsrc/server/client.qc
qcsrc/server/player.qc

diff --combined qcsrc/server/client.qc
index 97fcfcad4b70af2500c29b595ca2156ae0f15871,168ca84968c5e6fc75422b18fc777880874b3c12..aad1629fcb2af38b9d9b71b7ebd4ba2ffc2679df
@@@ -383,11 -383,12 +383,12 @@@ void FixPlayermodel(entity player
        {
                if(teamplay)
                {
-                       string s = Static_Team_ColorName_Lower(player.team);
-                       if (s != "neutral")
+                       switch(player.team)
                        {
-                               defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
-                               defaultskin = cvar(strcat("sv_defaultplayerskin_", s));
+                               case NUM_TEAM_1: defaultmodel = autocvar_sv_defaultplayermodel_red; defaultskin = autocvar_sv_defaultplayerskin_red; break;
+                               case NUM_TEAM_2: defaultmodel = autocvar_sv_defaultplayermodel_blue; defaultskin = autocvar_sv_defaultplayerskin_blue; break;
+                               case NUM_TEAM_3: defaultmodel = autocvar_sv_defaultplayermodel_yellow; defaultskin = autocvar_sv_defaultplayerskin_yellow; break;
+                               case NUM_TEAM_4: defaultmodel = autocvar_sv_defaultplayermodel_pink; defaultskin = autocvar_sv_defaultplayerskin_pink; break;
                        }
                }
  
        {
                if(teamplay)
                {
-                       string s = Static_Team_ColorName_Lower(player.team);
-                       if (s != "neutral")
-                               defaultskin = cvar(strcat("sv_defaultplayerskin_", s));
+                       switch(player.team)
+                       {
+                               case NUM_TEAM_1: defaultskin = autocvar_sv_defaultplayerskin_red; break;
+                               case NUM_TEAM_2: defaultskin = autocvar_sv_defaultplayerskin_blue; break;
+                               case NUM_TEAM_3: defaultskin = autocvar_sv_defaultplayerskin_yellow; break;
+                               case NUM_TEAM_4: defaultskin = autocvar_sv_defaultplayerskin_pink; break;
+                       }
                }
  
                if(!defaultskin)
@@@ -651,6 -656,7 +656,7 @@@ void PutClientInServer(entity this
                        IL_PUSH(g_bot_targets, this);
                this.bot_attack = true;
                this.monster_attack = true;
+               navigation_dynamicgoal_init(this, false);
  
                PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
  
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
                        .entity weaponentity = weaponentities[slot];
-                       if(slot == 0)
+                       if(slot == 0 || autocvar_g_weaponswitch_debug == 1)
                                this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity);
                        else
                                this.(weaponentity).m_switchweapon = WEP_Null;
@@@ -901,7 -907,7 +907,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;
@@@ -931,9 -937,11 +937,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;
  
@@@ -1223,6 -1231,8 +1229,8 @@@ void ClientConnect(entity this
                sv_notice_join(this);
  
        // update physics stats (players can spawn before physics runs)
+       STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
+       MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this); // do it BEFORE the function so we can modify highspeed!
        Physics_UpdateStats(this, PHYS_HIGHSPEED(this));
  
        IL_EACH(g_initforplayer, it.init_for_player, {
@@@ -2371,6 -2381,13 +2379,13 @@@ void PlayerPreThink (entity this
                                }
                        } else {
                                if (frametime) player_anim(this);
+                               if (this.respawn_flags & RESPAWN_DENY)
+                               {
+                                       STAT(RESPAWN_TIME, this) = 0;
+                                       return;
+                               }
                                bool button_pressed = (PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this));
  
                                switch(this.deadflag)
diff --combined qcsrc/server/player.qc
index 84694401f2081d103ea0fcad2c52799d7a5323c0,9458f1dc065d2ca0fb99685b042a5ea716c5890e..8598bc095e76871416d0b535c7667185e09ad080
@@@ -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;
@@@ -678,6 -678,12 +678,12 @@@ void dedicated_print(string input
        if (server_is_dedicated) print(input);
  }
  
+ void PrintToChat(entity player, string text)
+ {
+       text = strcat("\{1}^7", text, "\n");
+       sprint(player, text);
+ }
  /**
   * message "": do not say, just test flood control
   * return value: