742ec3e201d2b9c73419548d1390e30fca3b14b6
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / util_server.qc
1 #include "util_server.qh"
2
3 #include "common.qh"
4
5 #if defined(CSQC)
6 #elif defined(MENUQC)
7 #elif defined(SVQC)
8     #include "../csqcmodel/sv_model.qh"
9 #endif
10 #include "common.qh"
11
12 void WarpZoneLib_ExactTrigger_Init()
13 {SELFPARAM();
14         vector mi, ma;
15         if (self.movedir == '0 0 0')
16         if (self.angles != '0 0 0')
17         {
18                 makevectors (self.angles);
19                 self.movedir = v_forward;
20         }
21         if(self.model == "")
22         {
23                 // It's a box! No need to match with exacttriggers.
24                 self.warpzone_isboxy = 1;
25         }
26         else
27         {
28                 mi = self.mins;
29                 ma = self.maxs;
30                 precache_model(self.model);
31                 _setmodel(self, self.model);
32                 // let mapper-set mins/maxs override the model's bounds if set
33                 if(mi != '0 0 0' || ma != '0 0 0')
34                 {
35                         // It's a box! No need to match with exacttriggers.
36                         self.mins = mi;
37                         self.maxs = ma;
38                         self.warpzone_isboxy = 1;
39                 }
40         }
41         setorigin(self, self.origin);
42         if(self.scale)
43                 setsize(self, self.mins * self.scale, self.maxs * self.scale);
44         else
45                 setsize(self, self.mins, self.maxs);
46         self.movetype = MOVETYPE_NONE;
47         self.solid = SOLID_TRIGGER;
48         self.model = "";
49 }