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