From: Mario Date: Fri, 1 Jan 2016 10:42:21 +0000 (+1000) Subject: Use new loop for finding player's placed mines X-Git-Tag: xonotic-v0.8.2~1336 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d887154489c6a248492466bd3c563ac6ae47de81;p=xonotic%2Fxonotic-data.pk3dir.git Use new loop for finding player's placed mines --- diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 4f512e61b..d0cb0a827 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -73,11 +73,12 @@ bool client_hasweapon(entity cl, Weapon wpn, float andammo, bool complain) WITH(entity, self, cl, f = wpn.wr_checkammo1(wpn) + wpn.wr_checkammo2(wpn)); // always allow selecting the Mine Layer if we placed mines, so that we can detonate them - entity mine; if(wpn == WEP_MINE_LAYER) - for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == cl) - f = 1; - + FOREACH_ENTITY_CLASS("mine", it.owner == cl, + { + f = 1; + break; // no need to continue + }); } if (!f) {