]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/rubble.qc
Patches #434 from terencehill
[divverent/nexuiz.git] / data / qcsrc / client / rubble.qc
1 .float creationtime;
2
3 void RubbleDrop(entity list, void() deleteproc)
4 {
5     float t,tt;
6     entity rub,old_rub;
7
8     rub = findchainentity(owner,list);
9     while(rub)
10     {
11         if(rub.creationtime > t)
12         {
13             old_rub = rub;
14             tt = t;
15         }
16         rub = rub.chain;
17     }
18
19     rub = self;
20     self = old_rub;
21     deleteproc();
22     self = rub;
23 }
24
25 entity RubbleNew(entity list)
26 {
27     entity rub;
28
29     rub = spawn();
30     rub.creationtime = time;
31     rub.owner = list;
32
33     return rub;
34 }