From: Lyberta Date: Mon, 4 Dec 2017 17:55:51 +0000 (+0300) Subject: OK weapons: Added secondary blaster during countdown. X-Git-Tag: xonotic-v0.8.5~2119^2~47 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c29e5e56e59a607bab4cdbfcba816e6316ab426;p=xonotic%2Fxonotic-data.pk3dir.git OK weapons: Added secondary blaster during countdown. --- 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);