]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/misc/corner.qc
Merge branch 'terencehill/lms_itemtimes_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / misc / corner.qc
1 REGISTER_NET_LINKED(ENT_CLIENT_CORNER)
2
3 #ifdef SVQC
4 bool corner_send(entity to, int sf)
5 {SELFPARAM();
6         WriteHeader(MSG_ENTITY, ENT_CLIENT_CORNER);
7
8         WriteString(MSG_ENTITY, self.platmovetype);
9
10         WriteCoord(MSG_ENTITY, self.origin_x);
11         WriteCoord(MSG_ENTITY, self.origin_y);
12         WriteCoord(MSG_ENTITY, self.origin_z);
13
14         WriteString(MSG_ENTITY, self.target);
15         WriteString(MSG_ENTITY, self.target2);
16         WriteString(MSG_ENTITY, self.target3);
17         WriteString(MSG_ENTITY, self.target4);
18         WriteString(MSG_ENTITY, self.targetname);
19         WriteByte(MSG_ENTITY, self.target_random);
20
21         WriteByte(MSG_ENTITY, self.wait);
22
23         return true;
24 }
25
26 void corner_link()
27 {
28         //Net_LinkEntity(self, false, 0, corner_send);
29 }
30
31 spawnfunc(path_corner)
32 {
33         // setup values for overriding train movement
34         // if a second value does not exist, both start and end speeds are the single value specified
35         set_platmovetype(self, self.platmovetype);
36
37         corner_link();
38 }
39 #elif defined(CSQC)
40
41 void corner_remove(entity this)
42 {
43         if(this.target) { strunzone(this.target); }
44         this.target = string_null;
45
46         if(this.target2) { strunzone(this.target2); }
47         this.target2 = string_null;
48
49         if(this.target3) { strunzone(this.target3); }
50         this.target3 = string_null;
51
52         if(this.target4) { strunzone(this.target4); }
53         this.target4 = string_null;
54
55         if(this.targetname) { strunzone(this.targetname); }
56         this.targetname = string_null;
57
58         if(this.platmovetype) { strunzone(this.platmovetype); }
59         this.platmovetype = string_null;
60 }
61
62 NET_HANDLE(ENT_CLIENT_CORNER, bool isnew)
63 {
64         self.platmovetype = strzone(ReadString());
65
66         self.origin_x = ReadCoord();
67         self.origin_y = ReadCoord();
68         self.origin_z = ReadCoord();
69         setorigin(self, self.origin);
70
71         self.target = strzone(ReadString());
72         self.target2 = strzone(ReadString());
73         self.target3 = strzone(ReadString());
74         self.target4 = strzone(ReadString());
75         self.targetname = strzone(ReadString());
76         self.target_random = ReadByte();
77
78         self.wait = ReadByte();
79
80         return = true;
81
82         self.classname = "path_corner";
83         self.drawmask = MASK_NORMAL;
84         self.entremove = corner_remove;
85
86         set_platmovetype(self, self.platmovetype);
87 }
88
89 #endif