1 #include "teleport_dest.qh"
2 REGISTER_NET_LINKED(ENT_CLIENT_TELEPORT_DEST)
6 bool teleport_dest_send(entity this, entity to, int sf)
8 WriteHeader(MSG_ENTITY, ENT_CLIENT_TELEPORT_DEST);
9 WriteByte(MSG_ENTITY, sf);
13 WriteByte(MSG_ENTITY, this.cnt);
14 WriteCoord(MSG_ENTITY, this.speed);
15 WriteString(MSG_ENTITY, this.targetname);
16 WriteCoord(MSG_ENTITY, this.origin_x);
17 WriteCoord(MSG_ENTITY, this.origin_y);
18 WriteCoord(MSG_ENTITY, this.origin_z);
20 WriteAngle(MSG_ENTITY, this.mangle_x);
21 WriteAngle(MSG_ENTITY, this.mangle_y);
22 WriteAngle(MSG_ENTITY, this.mangle_z);
28 void teleport_dest_link(entity this)
30 Net_LinkEntity(this, false, 0, teleport_dest_send);
31 this.SendFlags |= 1; // update
34 spawnfunc(info_teleport_destination)
36 this.mangle = this.angles;
37 this.angles = '0 0 0';
39 //setorigin(this, this.origin + '0 0 27'); // To fix a mappers' habit as old as Quake
40 setorigin(this, this.origin);
46 objerror (this, "^3Teleport destination without a targetname");
48 teleport_dest_link(this);
51 spawnfunc(misc_teleporter_dest)
53 spawnfunc_info_teleport_destination(this);
56 spawnfunc(target_teleporter)
58 spawnfunc_info_teleport_destination(this);
63 void teleport_dest_remove(entity this)
66 //strunzone(this.classname);
67 //this.classname = string_null;
70 strunzone(this.targetname);
71 this.targetname = string_null;
74 NET_HANDLE(ENT_CLIENT_TELEPORT_DEST, bool isnew)
80 this.classname = "info_teleport_destination";
81 this.cnt = ReadByte();
82 this.speed = ReadCoord();
83 this.targetname = strzone(ReadString());
84 this.origin_x = ReadCoord();
85 this.origin_y = ReadCoord();
86 this.origin_z = ReadCoord();
88 this.mangle_x = ReadAngle();
89 this.mangle_y = ReadAngle();
90 this.mangle_z = ReadAngle();
92 setorigin(this, this.origin);
94 this.drawmask = MASK_NORMAL;
95 this.entremove = teleport_dest_remove;