1 REGISTER_NET_LINKED(ENT_CLIENT_LADDER)
3 void func_ladder_touch()
14 other.ladder_time = time + 0.1;
15 other.ladder_entity = self;
19 bool func_ladder_send(entity to, int sf)
21 WriteHeader(MSG_ENTITY, ENT_CLIENT_LADDER);
24 if(self.warpzone_isboxy)
26 if(self.origin != '0 0 0')
28 WriteByte(MSG_ENTITY, f);
30 // we need THESE to render the warpzone (and cull properly)...
33 WriteCoord(MSG_ENTITY, self.origin.x);
34 WriteCoord(MSG_ENTITY, self.origin.y);
35 WriteCoord(MSG_ENTITY, self.origin.z);
38 WriteShort(MSG_ENTITY, self.modelindex);
39 WriteCoord(MSG_ENTITY, self.mins.x);
40 WriteCoord(MSG_ENTITY, self.mins.y);
41 WriteCoord(MSG_ENTITY, self.mins.z);
42 WriteCoord(MSG_ENTITY, self.maxs.x);
43 WriteCoord(MSG_ENTITY, self.maxs.y);
44 WriteCoord(MSG_ENTITY, self.maxs.z);
45 WriteByte(MSG_ENTITY, bound(1, self.scale * 16, 255));
47 WriteString(MSG_ENTITY, self.classname);
48 WriteByte(MSG_ENTITY, self.skin);
49 WriteCoord(MSG_ENTITY, self.speed);
51 trigger_common_write(false);
56 void func_ladder_link()
58 self.SendEntity = func_ladder_send;
59 self.SendFlags = 0xFFFFFF;
60 //self.model = "null";
63 void func_ladder_init()
65 //self.mdl = self.model;
66 string m = self.model;
67 WarpZoneLib_ExactTrigger_Init();
71 _setmodel(self, m); // no precision needed
73 setorigin(self, self.origin);
75 setsize(self, self.mins * self.scale, self.maxs * self.scale);
77 setsize(self, self.mins, self.maxs);
78 self.touch = func_ladder_touch;
79 BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
84 spawnfunc(func_ladder)
97 void func_ladder_remove()
99 if(self.classname) { strunzone(self.classname); }
100 self.classname = string_null;
103 NET_HANDLE(ENT_CLIENT_LADDER, bool isnew)
106 self.warpzone_isboxy = (f & 1);
109 self.origin_x = ReadCoord();
110 self.origin_y = ReadCoord();
111 self.origin_z = ReadCoord();
114 self.origin = '0 0 0';
116 self.modelindex = ReadShort();
117 self.mins_x = ReadCoord();
118 self.mins_y = ReadCoord();
119 self.mins_z = ReadCoord();
120 self.maxs_x = ReadCoord();
121 self.maxs_y = ReadCoord();
122 self.maxs_z = ReadCoord();
123 self.scale = ReadByte() / 16;
124 self.classname = strzone(ReadString());
125 self.skin = ReadByte();
126 self.speed = ReadCoord();
128 trigger_common_read(false);
130 self.solid = SOLID_TRIGGER;
131 self.move_touch = func_ladder_touch;
132 self.drawmask = MASK_NORMAL;
133 self.move_time = time;
134 self.entremove = func_ladder_remove;