]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
OK weapons: Added secondary blaster during countdown.
authorLyberta <lyberta@lyberta.net>
Mon, 4 Dec 2017 17:55:51 +0000 (20:55 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 4 Dec 2017 17:55:51 +0000 (20:55 +0300)
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc

index 371d1640d2762a183d4ee6e1865cbdda1b4ba350..c2ca5cd995798d41d8d5e243f655112e9fdeb9ec 100644 (file)
@@ -120,6 +120,36 @@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon)
        return true;
 }
 
+MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
+{
+       if (game_stopped)
+       {
+               return;
+       }
+       entity player = M_ARGV(0, entity);
+       if (!IS_PLAYER(player) || IS_DEAD(player) || STAT(FROZEN, player))
+       {
+               return;
+       }
+       if (!PHYS_INPUT_BUTTON_ATCK2(player) || forbidWeaponUse(player) ||
+               !(round_handler_IsActive() && !round_handler_IsRoundStarted()))
+       {
+               return;
+       }
+       // Allow secondary blaster during countdown.
+       for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+       {
+               .entity weaponentity = weaponentities[slot];
+               Weapon weapon = player.(weaponentity).m_weapon;
+               if (weapon == WEP_Null && slot != 0)
+               {
+                       continue;
+               }
+               weapon.wr_think(weapon, player, weaponentity, 2);
+       }
+       PHYS_INPUT_BUTTON_ATCK2(player) = false;
+}
+
 MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect)
 {
        entity player = M_ARGV(0, entity);