]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/rubble.qc
Replace all direct assignments to self with setself(e)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / rubble.qc
index 11f547625c888471231307a82234a9d28b586bc4..8035fd76e127028dc218ef2ec5942a3802992add 100644 (file)
@@ -6,12 +6,9 @@ void RubbleLimit(string cname, float limit, void() deleteproc)
 {SELFPARAM();
        entity e;
        entity oldest;
-       entity oldself;
        float c;
        float oldesttime;
 
-       oldself = self;
-
        // remove rubble of the same type if it's at the limit
        // remove multiple rubble if the limit has been decreased
        while(1)
@@ -42,9 +39,8 @@ void RubbleLimit(string cname, float limit, void() deleteproc)
                        break;
 
                // delete this oldest one and search again
-               self = oldest;
-               deleteproc();
-               self = oldself;
+               SELFCALL(oldest, deleteproc());
+               SELFCALL_DONE();
        }
 }