Merge branch 'master' into Mario/wepent_experimental
authorMario <mario@smbclan.net>
Tue, 3 Jan 2017 12:37:45 +0000 (22:37 +1000)
committerMario <mario@smbclan.net>
Tue, 3 Jan 2017 12:37:45 +0000 (22:37 +1000)
# Conflicts:
# qcsrc/common/mutators/mutator/overkill/sv_overkill.qc

1  2 
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/server/client.qc
qcsrc/server/mutators/events.qh
qcsrc/server/player.qc

@@@ -118,23 -171,8 +118,6 @@@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink
        if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player))
                return;
  
-       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
-       {
-               .entity weaponentity = weaponentities[slot];
-               entity thiswep = player.(weaponentity);
-               if(player.ok_lastwep[slot] && player.ok_lastwep[slot] != WEP_Null)
-               {
-                       Weapon newwep = player.ok_lastwep[slot];
-                       if(player.ok_lastwep[slot] == WEP_HMG)
-                               newwep = WEP_MACHINEGUN;
-                       if(player.ok_lastwep[slot] == WEP_RPC)
-                               newwep = WEP_VORTEX;
-                       thiswep.m_switchweapon = newwep;
-                       player.ok_lastwep[slot] = WEP_Null;
-               }
-       }
 -      ok_IncreaseCharge(player, PS(player).m_weapon.m_id);
--
        if(PHYS_INPUT_BUTTON_ATCK2(player))
        if( !forbidWeaponUse(player) || player.weapon_blocked // allow if weapon is blocked
                || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
        PHYS_INPUT_BUTTON_ATCK2(player) = false;
  }
  
--MUTATOR_HOOKFUNCTION(ok, PlayerSpawn)
 -{
 -      entity player = M_ARGV(0, entity);
 -
 -      if(autocvar_g_overkill_ammo_charge)
 -      {
 -              FOREACH(Weapons, it != WEP_Null, LAMBDA(player.ammo_charge[it.m_id] = autocvar_g_overkill_ammo_charge_limit));
 -
 -              player.ok_use_ammocharge = 1;
 -              player.ok_notice_time = time;
 -      }
 -      else
 -              player.ok_use_ammocharge = 0;
 -}
 -
+ MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect)
  {
        entity player = M_ARGV(0, entity);
  
-       // if player changed their weapon while dead, don't switch to their death weapon
-       if(player.impulse)
 -      if(player.ok_lastwep)
++      for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
-               for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 -              Weapon newwep = Weapons_from(player.ok_lastwep);
 -              if(player.ok_lastwep == WEP_HMG.m_id)
 -                      newwep = WEP_MACHINEGUN;
 -              if(player.ok_lastwep == WEP_RPC.m_id)
 -                      newwep = WEP_VORTEX;
 -              PS(player).m_switchweapon = newwep;
 -              player.ok_lastwep = 0;
++              .entity weaponentity = weaponentities[slot];
++              entity thiswep = player.(weaponentity);
++
++              if(player.ok_lastwep[slot] && player.ok_lastwep[slot] != WEP_Null)
 +              {
++                      Weapon newwep = player.ok_lastwep[slot];
++                      if(player.ok_lastwep[slot] == WEP_HMG)
++                              newwep = WEP_MACHINEGUN;
++                      if(player.ok_lastwep[slot] == WEP_RPC)
++                              newwep = WEP_VORTEX;
++                      thiswep.m_switchweapon = newwep;
 +                      player.ok_lastwep[slot] = WEP_Null;
 +              }
        }
  }
  
Simple merge
@@@ -694,19 -700,14 +694,21 @@@ void PutClientInServer(entity this
                        delete(spot); // usefull for checking if there are spawnpoints, that let drop through the floor
                }
  
 -              PS(this).m_switchweapon = w_getbestweapon(this);
 -              this.cnt = -1; // W_LastWeapon will not complain
 -              PS(this).m_weapon = WEP_Null;
 -              this.weaponname = "";
 -              PS(this).m_switchingweapon = WEP_Null;
 +              for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 +              {
 +                      .entity weaponentity = weaponentities[slot];
 +                      if(slot == 0)
 +                              this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity);
 +                      else
 +                              this.(weaponentity).m_switchweapon = WEP_Null;
 +                      this.(weaponentity).m_weapon = WEP_Null;
 +                      this.(weaponentity).weaponname = "";
 +                      this.(weaponentity).m_switchingweapon = WEP_Null;
 +                      this.(weaponentity).cnt = -1;
 +              }
  
+               MUTATOR_CALLHOOK(PlayerWeaponSelect, this);
                if (!warmup_stage && !this.alivetime)
                        this.alivetime = time;
  
Simple merge
Simple merge