]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/triggers/misc/corner.qc
Don't even try to translate keys if game isn't translated
[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         strfree(this.target);
43         strfree(this.target2);
44         strfree(this.target3);
45         strfree(this.target4);
46         strfree(this.targetname);
47         strfree(this.platmovetype);
48 }
49
50 NET_HANDLE(ENT_CLIENT_CORNER, bool isnew)
51 {
52         this.platmovetype = strzone(ReadString());
53
54         this.origin = ReadVector();
55         setorigin(this, this.origin);
56
57         this.target = strzone(ReadString());
58         this.target2 = strzone(ReadString());
59         this.target3 = strzone(ReadString());
60         this.target4 = strzone(ReadString());
61         this.targetname = strzone(ReadString());
62         this.target_random = ReadByte();
63
64         this.wait = ReadByte();
65
66         return = true;
67
68         this.classname = "path_corner";
69         this.drawmask = MASK_NORMAL;
70         this.entremove = corner_remove;
71
72         set_platmovetype(this, this.platmovetype);
73 }
74
75 #endif