From: Mario Date: Fri, 1 Jan 2016 10:54:52 +0000 (+1000) Subject: Use loop to kill hooks attached to nade X-Git-Tag: xonotic-v0.8.2~1334 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5688c07d47feaa5130f1898941e598cbf9354806;p=xonotic%2Fxonotic-data.pk3dir.git Use loop to kill hooks attached to nade --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 3fd4d6ce5..6b0b1f5a3 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -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; }