2 #include "../dpdefs/csprogsdefs.qh"
9 // LordHavoc: rewrote this file, it was really bad code
11 void RubbleLimit(string cname, float limit, void() deleteproc)
21 // remove rubble of the same type if it's at the limit
22 // remove multiple rubble if the limit has been decreased
25 e = findchain(classname,cname);
28 // walk the list and count the entities, find the oldest
29 // initialize our search with the first entity
32 oldesttime = e.creationtime;
34 // compare to all other matching entities
38 if (oldesttime > e.creationtime)
40 oldesttime = e.creationtime;
46 // stop if there are less than the limit already
50 // delete this oldest one and search again
57 entity RubbleNew(string cname)
60 // spawn a new entity and return it
63 e.creationtime = time;