]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use loop to kill hooks attached to nade
authorMario <mario@smbclan.net>
Fri, 1 Jan 2016 10:54:52 +0000 (20:54 +1000)
committerMario <mario@smbclan.net>
Fri, 1 Jan 2016 10:54:52 +0000 (20:54 +1000)
qcsrc/common/mutators/mutator/nades/nades.qc

index 3fd4d6ce5c7358befb40498e1c6f43b62703b2a2..6b0b1f5a38891b60478f4f61b264abe898f2153f 100644 (file)
@@ -648,10 +648,11 @@ void nade_boom()
                case NADE_TYPE_MONSTER: nade_monster_boom(); break;
        }
 
-       entity head;
-       for(head = world; (head = find(head, classname, "grapplinghook")); )
-       if(head.aiment == self)
-               RemoveGrapplingHook(head.realowner);
+       FOREACH_ENTITY_ENT(aiment, self,
+       {
+               if(it.classname == "grapplinghook")
+                       RemoveGrapplingHook(it.realowner);
+       });
 
        remove(self);
 }
@@ -670,10 +671,11 @@ void nade_touch()
                is_weapclip = 1;*/
        if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip)
        {
-               entity head;
-               for(head = world; (head = find(head, classname, "grapplinghook")); )
-               if(head.aiment == self)
-                       RemoveGrapplingHook(head.realowner);
+               FOREACH_ENTITY_ENT(aiment, self,
+               {
+                       if(it.classname == "grapplinghook")
+                               RemoveGrapplingHook(it.realowner);
+               });
                remove(self);
                return;
        }