From: Mircea Kitsune Date: Mon, 4 Oct 2010 20:57:02 +0000 (+0300) Subject: Allow switching to the Mine Layer with no ammo when we have planted mines (wasn't... X-Git-Tag: xonotic-v0.1.0preview~307^2~33^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2d9fdd7d30c7e457a516d84bd9b1c1d43c19009b;p=xonotic%2Fxonotic-data.pk3dir.git Allow switching to the Mine Layer with no ammo when we have planted mines (wasn't that tricky :) ) --- diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index e5ad4b66d..c9a5dfc4a 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -981,6 +981,13 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) self = cl; f = weapon_action(wpn, WR_CHECKAMMO1); f = f + weapon_action(wpn, WR_CHECKAMMO2); + + // always allow selecting the Mine Layer if we placed mines, so that we can detonate them + local entity mine; + if(wpn == WEP_MINE_LAYER) + for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self) + f = 1; + self = oldself; } if (!f)