]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use new loop for finding player's placed mines
authorMario <mario@smbclan.net>
Fri, 1 Jan 2016 10:42:21 +0000 (20:42 +1000)
committerMario <mario@smbclan.net>
Fri, 1 Jan 2016 10:42:21 +0000 (20:42 +1000)
qcsrc/server/weapons/selection.qc

index 4f512e61b2dfbeb6cd77002665807050cadb737f..d0cb0a82780d26177e41c54633c2b3147be52615 100644 (file)
@@ -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)
                        {