]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/rubble.qc
Port shockwave
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / rubble.qc
index 7f7c16269c5b6f6b58f3e9772fe2b323e113179e..5af2e235070f7c5d7b63f2fc3d30353f0f206cfd 100644 (file)
@@ -1,23 +1,14 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qc"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
-
-.float creationtime;
+#include "rubble.qh"
 
 // LordHavoc: rewrote this file, it was really bad code
 
 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)
@@ -48,9 +39,7 @@ void RubbleLimit(string cname, float limit, void() deleteproc)
                        break;
 
                // delete this oldest one and search again
-               self = oldest;
-               deleteproc();
-               self = oldself;
+               WITH(entity, self, oldest, deleteproc());
        }
 }