]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/target/music.qc
Self removal kit: update plan
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / target / music.qc
index 52f1fca0e27a723ecf5804b40700ee42074a9394..5a4e86c48b370d0dd65baa1f0553abfc433eefb0 100644 (file)
@@ -36,14 +36,13 @@ void target_music_reset(entity this)
 }
 void target_music_kill()
 {
-       for(self = world; (self = find(self, classname, "target_music")); )
-       {
-               self.volume = 0;
-               if(self.targetname == "")
-                       target_music_sendto(MSG_ALL, 1);
-               else
-                       target_music_sendto(MSG_ALL, 0);
-       }
+       FOREACH_ENTITY_CLASS("target_music", true, {
+               it.volume = 0;
+        if (it.targetname == "")
+            WITHSELF(it, target_music_sendto(MSG_ALL, 1));
+        else
+            WITHSELF(it, target_music_sendto(MSG_ALL, 0));
+       });
 }
 void target_music_use()
 {