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(entity this)
29 Net_LinkEntity(this, false, 0, teleport_dest_send);
30 this.SendFlags |= 1; // update
33 spawnfunc(info_teleport_destination)
35 this.classname = "info_teleport_destination";
37 this.mangle = this.angles;
38 this.angles = '0 0 0';
40 //setorigin(this, this.origin + '0 0 27'); // To fix a mappers' habit as old as Quake
41 setorigin(this, this.origin);
47 objerror (this, "^3Teleport destination without a targetname");
49 teleport_dest_link(this);
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(this.classname);
68 //this.classname = string_null;
71 strunzone(this.targetname);
72 this.targetname = string_null;
75 NET_HANDLE(ENT_CLIENT_TELEPORT_DEST, bool isnew)
81 this.classname = "info_teleport_destination";
82 this.cnt = ReadByte();
83 this.speed = ReadCoord();
84 this.targetname = strzone(ReadString());
85 this.origin_x = ReadCoord();
86 this.origin_y = ReadCoord();
87 this.origin_z = ReadCoord();
89 this.mangle_x = ReadAngle();
90 this.mangle_y = ReadAngle();
91 this.mangle_z = ReadAngle();
93 setorigin(this, this.origin);
95 this.drawmask = MASK_NORMAL;
96 this.entremove = teleport_dest_remove;