From: Mircea Kitsune Date: Mon, 4 Oct 2010 20:40:49 +0000 (+0300) Subject: Don't switch away from the Mine Layer when pressing primary fire if there are mines... X-Git-Tag: xonotic-v0.1.0preview~307^2~33^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7d7f90be8b5be4e3ce4353ad172bc5cf509e580c;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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)) {