1 REGISTER_NET_LINKED(ENT_CLIENT_TELEPORT_DEST)
5 bool teleport_dest_send(entity this, entity to, int sf)
7 WriteHeader(MSG_ENTITY, ENT_CLIENT_TELEPORT_DEST);
8 WriteByte(MSG_ENTITY, sf);
12 WriteByte(MSG_ENTITY, this.cnt);
13 WriteCoord(MSG_ENTITY, this.speed);
14 WriteString(MSG_ENTITY, this.targetname);
15 WriteCoord(MSG_ENTITY, this.origin_x);
16 WriteCoord(MSG_ENTITY, this.origin_y);
17 WriteCoord(MSG_ENTITY, this.origin_z);
19 WriteAngle(MSG_ENTITY, this.mangle_x);
20 WriteAngle(MSG_ENTITY, this.mangle_y);
21 WriteAngle(MSG_ENTITY, this.mangle_z);
27 void teleport_dest_link()
29 Net_LinkEntity(self, false, 0, teleport_dest_send);
30 self.SendFlags |= 1; // update
33 spawnfunc(info_teleport_destination)
35 self.classname = "info_teleport_destination";
37 self.mangle = self.angles;
38 self.angles = '0 0 0';
40 //setorigin (self, self.origin + '0 0 27'); // To fix a mappers' habit as old as Quake
41 setorigin (self, self.origin);
47 objerror ("^3Teleport destination without a targetname");
52 spawnfunc(misc_teleporter_dest)
54 spawnfunc_info_teleport_destination(this);
57 spawnfunc(target_teleporter)
59 spawnfunc_info_teleport_destination(this);
64 void teleport_dest_remove(entity this)
67 //strunzone(self.classname);
68 //self.classname = string_null;
71 strunzone(this.targetname);
72 this.targetname = string_null;
75 NET_HANDLE(ENT_CLIENT_TELEPORT_DEST, bool isnew)
81 self.classname = "info_teleport_destination";
82 self.cnt = ReadByte();
83 self.speed = ReadCoord();
84 self.targetname = strzone(ReadString());
85 self.origin_x = ReadCoord();
86 self.origin_y = ReadCoord();
87 self.origin_z = ReadCoord();
89 self.mangle_x = ReadAngle();
90 self.mangle_y = ReadAngle();
91 self.mangle_z = ReadAngle();
93 setorigin(self, self.origin);
95 self.drawmask = MASK_NORMAL;
96 self.entremove = teleport_dest_remove;