From 7d7f90be8b5be4e3ce4353ad172bc5cf509e580c Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Mon, 4 Oct 2010 23:40:49 +0300 Subject: [PATCH] Don't switch away from the Mine Layer when pressing primary fire if there are mines placed on the ground. Being able to select the mine layer again if you switched to another weapon however (if you have no ammo) is a bit trickier. --- qcsrc/server/cl_weaponsystem.qc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 925d53fa7..e372fd1aa 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1090,6 +1090,12 @@ void W_SwitchToOtherWeapon(entity pl) } float weapon_prepareattack_checkammo(float secondary) { + // always keep the Mine Layer if we placed mines, so that we can detonate them + local entity mine; + if(self.weapon == WEP_MINE_LAYER) + for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self) + return TRUE; + if not(self.items & IT_UNLIMITED_WEAPON_AMMO) if (!weapon_action(self.weapon, WR_CHECKAMMO1 + secondary)) { -- 2.39.2