#include "miscfunctions.qc"
#include "movelib.qc"
#include "player_skeleton.qc"
-#include "rubble.qc"
#include "scoreboard.qc"
#include "shownames.qc"
#include "teamradar.qc"
+++ /dev/null
-#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;
- float c;
- float oldesttime;
-
- // remove rubble of the same type if it's at the limit
- // remove multiple rubble if the limit has been decreased
- while(1)
- {
- e = findchain(classname,cname);
- if (e == world)
- break;
- // walk the list and count the entities, find the oldest
- // initialize our search with the first entity
- c = 1;
- oldest = e;
- oldesttime = e.creationtime;
- e = e.chain;
- // compare to all other matching entities
- while (e)
- {
- c = c + 1;
- if (oldesttime > e.creationtime)
- {
- oldesttime = e.creationtime;
- oldest = e;
- }
- e = e.chain;
- }
-
- // stop if there are less than the limit already
- if (c <= limit)
- break;
-
- // delete this oldest one and search again
- WITH(entity, self, oldest, deleteproc());
- }
-}
-
-entity RubbleNew(string cname)
-{
- // spawn a new entity and return it
- entity e = spawn();
- e.classname = cname;
- e.creationtime = time;
- return e;
-}
+++ /dev/null
-#ifndef CLIENT_RUBBLE_H
-#define CLIENT_RUBBLE_H
-entityclass(Rubble);
-class(Rubble) .float creationtime;
-void RubbleLimit(string cname, float limit, void() deleteproc);
-entity RubbleNew(string cname);
-#endif
#ifdef CSQC
#include "../../movetypes/movetypes.qh"
-#include "../../../client/rubble.qh"
+#include "rubble.qh"
#endif
REGISTER_NET_TEMP(casings)
--- /dev/null
+#ifndef RUBBLE_H
+#define RUBBLE_H
+
+#ifdef CSQC
+
+entityclass(Rubble);
+class(Rubble).float creationtime;
+
+void RubbleLimit(string cname, float limit, void() deleteproc)
+{
+ SELFPARAM();
+ entity e;
+ entity oldest;
+ float c;
+ float oldesttime;
+
+ // remove rubble of the same type if it's at the limit
+ // remove multiple rubble if the limit has been decreased
+ while (1)
+ {
+ e = findchain(classname, cname);
+ if (e == world) break;
+ // walk the list and count the entities, find the oldest
+ // initialize our search with the first entity
+ c = 1;
+ oldest = e;
+ oldesttime = e.creationtime;
+ e = e.chain;
+ // compare to all other matching entities
+ while (e)
+ {
+ c = c + 1;
+ if (oldesttime > e.creationtime)
+ {
+ oldesttime = e.creationtime;
+ oldest = e;
+ }
+ e = e.chain;
+ }
+
+ // stop if there are less than the limit already
+ if (c <= limit) break;
+
+ // delete this oldest one and search again
+ WITH(entity, self, oldest, deleteproc());
+ }
+}
+
+entity RubbleNew(string cname)
+{
+ // spawn a new entity and return it
+ entity e = spawn();
+ e.classname = cname;
+ e.creationtime = time;
+ return e;
+}
+
+#endif
+
+#endif