]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/rubble.qh
Merge branch 'master' into Mario/killother
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / rubble.qh
index 1a7cad850b19806dbdbc58df63a257c0f53612b7..7848b7b1f3a31d34d6069c9920ed81359f608952 100644 (file)
@@ -6,9 +6,8 @@
 entityclass(Rubble);
 class(Rubble).float creationtime;
 
-void RubbleLimit(string cname, float limit, void() deleteproc)
+void RubbleLimit(string cname, float limit, void(entity) deleteproc)
 {
-       SELFPARAM();
        entity e;
        entity oldest;
        float c;
@@ -19,7 +18,7 @@ void RubbleLimit(string cname, float limit, void() deleteproc)
        while (1)
        {
                e = findchain(classname, cname);
-               if (e == world) break;
+               if (e == NULL) break;
                // walk the list and count the entities, find the oldest
                // initialize our search with the first entity
                c = 1;
@@ -42,7 +41,7 @@ void RubbleLimit(string cname, float limit, void() deleteproc)
                if (c <= limit) break;
 
                // delete this oldest one and search again
-               WITH(entity, self, oldest, deleteproc());
+               deleteproc(oldest);
        }
 }