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