Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
teleport_dest.qc File Reference
#include "teleport_dest.qh"
Include dependency graph for teleport_dest.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 spawnfunc (info_teleport_destination)
 spawnfunc (misc_teleporter_dest)
void teleport_dest_link (entity this)
bool teleport_dest_send (entity this, entity to, int sendflags)

Function Documentation

◆ spawnfunc() [1/2]

spawnfunc ( info_teleport_destination )

Definition at line 29 of file teleport_dest.qc.

30{
31 this.mangle = this.angles;
32 this.angles = '0 0 0';
33
34 //setorigin(this, this.origin + '0 0 27'); // To fix a mappers' habit as old as Quake
35 setorigin(this, this.origin);
36
37 if(!this.targetname || this.targetname == "")
38 {
39 objerror (this, "^3Teleport destination without a targetname");
40 return; // don't link it to CSQC in this case!
41 }
42
44}
vector origin
ent angles
Definition ent_cs.qc:121
#define objerror
Definition pre.qh:8
vector mangle
Definition subs.qh:51
void teleport_dest_link(entity this)
string targetname
Definition triggers.qh:56

References angles, mangle, objerror, origin, targetname, and teleport_dest_link().

◆ spawnfunc() [2/2]

spawnfunc ( misc_teleporter_dest )

Definition at line 46 of file teleport_dest.qc.

47{
48 spawnfunc_info_teleport_destination(this);
49}

◆ teleport_dest_link()

void teleport_dest_link ( entity this)

Definition at line 23 of file teleport_dest.qc.

24{
25 Net_LinkEntity(this, false, 0, teleport_dest_send);
27}
const int SF_TRIGGER_INIT
Definition defs.qh:22
int SendFlags
Definition net.qh:118
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:123
bool teleport_dest_send(entity this, entity to, int sendflags)

References entity(), Net_LinkEntity(), SendFlags, SF_TRIGGER_INIT, and teleport_dest_send().

Referenced by spawnfunc().

◆ teleport_dest_send()

bool teleport_dest_send ( entity this,
entity to,
int sendflags )

Definition at line 6 of file teleport_dest.qc.

7{
8 WriteHeader(MSG_ENTITY, ENT_CLIENT_TELEPORT_DEST);
9 WriteByte(MSG_ENTITY, sendflags);
10
11 if(sendflags & SF_TRIGGER_INIT)
12 {
16 WriteVector(MSG_ENTITY, this.origin);
17 WriteAngleVector(MSG_ENTITY, this.mangle);
18 }
19
20 return true;
21}
float cnt
Definition powerups.qc:24
float speed
Definition dynlight.qc:9
const int MSG_ENTITY
Definition net.qh:115
#define WriteHeader(to, id)
Definition net.qh:221
void WriteString(string data, float dest, float desto)
void WriteCoord(float data, float dest, float desto)
void WriteByte(float data, float dest, float desto)

References cnt, entity(), mangle, MSG_ENTITY, origin, SF_TRIGGER_INIT, speed, targetname, WriteByte(), WriteCoord(), WriteHeader, and WriteString().

Referenced by teleport_dest_link().