Merge branch 'master' into Mario/wepent_experimental
authorMario <mario@smbclan.net>
Thu, 6 Oct 2016 12:54:47 +0000 (22:54 +1000)
committerMario <mario@smbclan.net>
Thu, 6 Oct 2016 12:54:47 +0000 (22:54 +1000)
# Conflicts:
# qcsrc/common/mutators/mutator/overkill/sv_overkill.qc

1  2 
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc

index 7201aaa0d8d4c6ecc96e68e21cc16efa5d2059d2,f86c71b7eb694d0cf0032165fe3b5fc114b2dcf0..cbc49be16513fa5d1cebbb2d3ed1724368f05910
@@@ -10,11 -10,19 +10,9 @@@ bool autocvar_g_overkill_100a_anyway
  
  .vector ok_deathloc;
  .float ok_spawnsys_timer;
 -.float ok_lastwep;
 +.Weapon ok_lastwep[MAX_WEAPONSLOTS];
  .float ok_item;
  
- .float ok_pauseregen_finished;
 -.float ok_notice_time;
 -.float ammo_charge[Weapons_MAX];
 -.float ok_use_ammocharge = _STAT(OK_AMMO_CHARGE);
 -.float ok_ammo_charge = _STAT(OK_AMMO_CHARGEPOOL);
 -
 -void(entity ent, float wep) ok_DecreaseCharge;
--
  void ok_Initialize();
  
  REGISTER_MUTATOR(ok, cvar("g_overkill") && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
@@@ -153,25 -172,22 +118,26 @@@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink
        if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player))
                return;
  
 -      if(player.ok_lastwep)
 +      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);
  
 -      ok_IncreaseCharge(player, PS(player).m_weapon.m_id);
 +              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;
 +              }
 +      }
  
        if(PHYS_INPUT_BUTTON_ATCK2(player))
-       if(!forbidWeaponUse(player) || player.weapon_blocked) // allow if weapon is blocked
+       if( !forbidWeaponUse(player) || player.weapon_blocked // allow if weapon is blocked
+               || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
        if(time >= player.jump_interval)
        {
                player.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(player);
@@@ -211,16 -240,19 +177,14 @@@ 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;
 -
        // if player changed their weapon while dead, don't switch to their death weapon
        if(player.impulse)
 -              player.ok_lastwep = 0;
 +      {
 +              for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
 +              {
 +                      player.ok_lastwep[slot] = WEP_Null;
 +              }
 +      }
-       player.ok_pauseregen_finished = time + 2;
  }
  
  void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); }