From 8c29e5e56e59a607bab4cdbfcba816e6316ab426 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Mon, 4 Dec 2017 20:55:51 +0300 Subject: [PATCH 1/1] OK weapons: Added secondary blaster during countdown. --- .../mutators/mutator/overkill/sv_overkill.qc | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc index 371d1640d..c2ca5cd99 100644 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@ -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); -- 2.39.2