From: Mircea Kitsune Date: Mon, 4 Oct 2010 20:45:22 +0000 (+0300) Subject: Fix the last commit. It allowed the Mine Layer to go minus on ammo and place mines... X-Git-Tag: xonotic-v0.1.0preview~307^2~33^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2629080ac44648dc34b8dd5c20c97644466fe20b;p=xonotic%2Fxonotic-data.pk3dir.git Fix the last commit. It allowed the Mine Layer to go minus on ammo and place mines forever :P --- diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index e372fd1aa..e5ad4b66d 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1090,15 +1090,15 @@ 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)) { + // 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 FALSE; + W_SwitchToOtherWeapon(self); return FALSE; }