7 // LordHavoc: rewrote this file, it was really bad code
9 void RubbleLimit(string cname, float limit, void() deleteproc)
19 // remove rubble of the same type if it's at the limit
20 // remove multiple rubble if the limit has been decreased
23 e = findchain(classname,cname);
26 // walk the list and count the entities, find the oldest
27 // initialize our search with the first entity
30 oldesttime = e.creationtime;
32 // compare to all other matching entities
36 if (oldesttime > e.creationtime)
38 oldesttime = e.creationtime;
44 // stop if there are less than the limit already
48 // delete this oldest one and search again
55 entity RubbleNew(string cname)
58 // spawn a new entity and return it
61 e.creationtime = time;