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

Go to the source code of this file.

Macros

#define TDEATHLOOP(o)
#define TELEPORT_FLAGS_PORTAL   (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH | TELEPORT_FLAG_FORCE_TDEATH)
#define TELEPORT_FLAGS_TELEPORTER   (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
#define TELEPORT_FLAGS_WARPZONE   0

Functions

float check_tdeath (entity player, vector org, vector telefragmin, vector telefragmax)
void Reset_ArcBeam (entity player, vector forward)
entity Simple_TeleportPlayer (entity teleporter, entity player)
void spawn_tdeath (vector v0, entity e, vector v)
 STATIC_INIT (g_teleporters)
void tdeath (entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax)
entity Teleport_Find (vector mi, vector ma)
void teleport_findtarget (entity this)
void Teleport_Touch (entity this, entity toucher)
void TeleportPlayer (entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
void trigger_teleport_use (entity this, entity actor, entity trigger)
void WarpZone_PostTeleportPlayer_Callback (entity pl)

Variables

bool autocvar_g_telefrags
bool autocvar_g_telefrags_avoid
bool autocvar_g_telefrags_teamplay
IntrusiveList g_teleporters
entity pusher
entity realowner
float tdeath_hit
const int TELEPORT_FLAG_FORCE_TDEATH = BIT(3)
const int TELEPORT_FLAG_PARTICLES = BIT(1)
const int TELEPORT_FLAG_SOUND = BIT(0)
const int TELEPORT_FLAG_TDEATH = BIT(2)
const int TELEPORT_NORMAL = 1
const int TELEPORT_SIMPLE = 2
float teleportable

Macro Definition Documentation

◆ TDEATHLOOP

#define TDEATHLOOP ( o)
Value:
vector deathmin = (o) + player.mins; \
vector deathmax = (o) + player.maxs; \
if(telefragmin != telefragmax) \
{ \
if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
} \
float deathradius = max(vlen(deathmin), vlen(deathmax)); \
for (entity head = findradius(o, deathradius); head; head = head.chain) \
if (head != player && head.takedamage && boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity chain
vector absmax
vector absmin
v y
Definition ent_cs.qc:121
float vlen(vector v)
float max(float f,...)
vector
Definition self.qh:92
for(int slot=0;slot< MAX_WEAPONSLOTS;++slot)
Definition impulse.qc:97
float takedamage
Definition subs.qh:78
if(frag_attacker.flagcarried)
Definition sv_ctf.qc:2325
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
Definition vector.qh:73

Definition at line 43 of file teleporters.qh.

43#define TDEATHLOOP(o) \
44 vector deathmin = (o) + player.mins; \
45 vector deathmax = (o) + player.maxs; \
46 if(telefragmin != telefragmax) \
47 { \
48 if(deathmin.x > telefragmin.x) deathmin.x = telefragmin.x; \
49 if(deathmin.y > telefragmin.y) deathmin.y = telefragmin.y; \
50 if(deathmin.z > telefragmin.z) deathmin.z = telefragmin.z; \
51 if(deathmax.x < telefragmax.x) deathmax.x = telefragmax.x; \
52 if(deathmax.y < telefragmax.y) deathmax.y = telefragmax.y; \
53 if(deathmax.z < telefragmax.z) deathmax.z = telefragmax.z; \
54 } \
55 float deathradius = max(vlen(deathmin), vlen(deathmax)); \
56 for (entity head = findradius(o, deathradius); head; head = head.chain) \
57 if (head != player && head.takedamage && boxesoverlap(deathmin, deathmax, head.absmin, head.absmax))

Referenced by check_tdeath(), and tdeath().

◆ TELEPORT_FLAGS_PORTAL

Definition at line 21 of file teleporters.qh.

Referenced by Portal_TeleportPlayer().

◆ TELEPORT_FLAGS_TELEPORTER

#define TELEPORT_FLAGS_TELEPORTER   (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)

Definition at line 22 of file teleporters.qh.

Referenced by nade_translocate_boom().

◆ TELEPORT_FLAGS_WARPZONE

#define TELEPORT_FLAGS_WARPZONE   0

Definition at line 20 of file teleporters.qh.

Function Documentation

◆ check_tdeath()

float check_tdeath ( entity player,
vector org,
vector telefragmin,
vector telefragmax )

Definition at line 23 of file teleporters.qc.

24{
25 if (IS_PLAYER(player) && !IS_DEAD(player))
26 {
28 {
29 #ifdef SVQC
30 if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
31 #endif
32 if(IS_PLAYER(head))
33 if(!IS_DEAD(head))
34 return 1;
35 }
36 }
37 return 0;
38}
#define IS_DEAD(s)
Definition player.qh:245
#define IS_PLAYER(s)
Definition player.qh:243
vector org
Definition self.qh:92
bool teamplay
Definition teams.qh:59
#define TDEATHLOOP(o)
bool autocvar_g_telefrags_teamplay
Definition teleporters.qh:7

References autocvar_g_telefrags_teamplay, entity(), IS_DEAD, IS_PLAYER, org, TDEATHLOOP, teamplay, and vector.

◆ Reset_ArcBeam()

void Reset_ArcBeam ( entity player,
vector forward )

Definition at line 46 of file arc.qc.

47{
48 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
49 {
50 .entity weaponentity = weaponentities[slot];
51 if(!player.(weaponentity).arc_beam)
52 continue;
53 player.(weaponentity).arc_beam.beam_dir = forward;
54 player.(weaponentity).arc_beam.beam_teleporttime = time;
55 }
56}
entity arc_beam
Definition arc.qh:128
float time
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17

References arc_beam, entity(), MAX_WEAPONSLOTS, time, vector, and weaponentities.

◆ Simple_TeleportPlayer()

entity Simple_TeleportPlayer ( entity teleporter,
entity player )

Definition at line 180 of file teleporters.qc.

181{
182 vector locout;
183 entity e = NULL;
184
185 // Find the output teleporter
186 if(teleporter.enemy)
187 {
188 e = teleporter.enemy;
189 }
190 else
191 {
192 // sorry CSQC, random stuff ain't gonna happen
193#ifdef SVQC
195 FOREACH_ENTITY_STRING(targetname, teleporter.target,
196 {
197 bool p = true;
198 if(STAT(TELEPORT_TELEFRAG_AVOID, player))
199 {
200 #ifdef SVQC
201 locout = it.origin + '0 0 1' * (1 - player.mins.z - 24);
202 #elif defined(CSQC)
203 locout = it.origin + '0 0 1' * (1 - player.mins.z - 24);
204 #endif
205 if(check_tdeath(player, locout, '0 0 0', '0 0 0'))
206 p = false;
207 }
208 RandomSelection_AddEnt(it, (it.cnt ? it.cnt : 1), p);
209 });
211#endif
212 }
213
214#ifdef SVQC
215 if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
216#elif defined(CSQC)
217 if(!e) { LOG_INFO("Teleport destination could not be found from CSQC."); }
218#endif
219
220 makevectors(e.mangle);
221
222 if(e.speed)
223 if(vdist(player.velocity, >, e.speed))
224 player.velocity = normalize(player.velocity) * max(0, e.speed);
225
226 if(!(teleporter.classname == "trigger_teleport" && (teleporter.spawnflags & TELEPORT_KEEP_SPEED)) &&
227 !(teleporter.classname == "target_teleporter" && (teleporter.spawnflags & TARGET_TELEPORTER_KEEP_SPEED)))
228 {
229 // test if player is slower than min
230 if(STAT(TELEPORT_MINSPEED, player))
231 if(vdist(player.velocity, <, STAT(TELEPORT_MINSPEED, player)))
232 player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MINSPEED, player));
233 // test if player is faster than max (or if min is above max)
234 if(STAT(TELEPORT_MAXSPEED, player))
235 if(vdist(player.velocity, >, STAT(TELEPORT_MAXSPEED, player)))
236 player.velocity = normalize(player.velocity) * max(0, STAT(TELEPORT_MAXSPEED, player));
237 }
238
239 locout = e.origin + '0 0 1' * (1 - player.mins.z - 24);
240
241 TeleportPlayer(teleporter, player, locout, e.mangle, v_forward * vlen(player.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
242
243 return e;
244}
vector v_forward
#define FOREACH_ENTITY_STRING(fld, match, body)
Definition iter.qh:184
#define STAT(...)
Definition stats.qh:82
#define LOG_INFO(...)
Definition log.qh:65
void sprint(float clientnum, string text,...)
vector normalize(vector v)
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
ERASEABLE void RandomSelection_Init()
Definition random.qc:4
#define RandomSelection_AddEnt(e, weight, priority)
Definition random.qh:14
entity RandomSelection_chosen_ent
Definition random.qh:5
#define TELEPORT_KEEP_SPEED
Definition teleport.qh:8
#define TARGET_TELEPORTER_KEEP_SPEED
Definition teleport.qh:11
void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
#define TELEPORT_FLAGS_TELEPORTER
string targetname
Definition triggers.qh:56
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8

References entity(), FOREACH_ENTITY_STRING, NULL, RandomSelection_AddEnt, RandomSelection_chosen_ent, RandomSelection_Init(), targetname, and vector.

Referenced by CheatCommand(), target_teleport_use(), Teleport_Touch(), and WarpZone_StartFrame().

◆ spawn_tdeath()

void spawn_tdeath ( vector v0,
entity e,
vector v )

Definition at line 61 of file teleporters.qc.

62{
63 tdeath(e, e, e, '0 0 0', '0 0 0');
64}
void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax)

References entity(), tdeath(), and vector.

◆ STATIC_INIT()

STATIC_INIT ( g_teleporters )

Definition at line 11 of file teleporters.qh.

11{ g_teleporters = IL_NEW(); }
#define IL_NEW()
IntrusiveList g_teleporters

References g_teleporters, and IL_NEW.

◆ tdeath()

void tdeath ( entity player,
entity teleporter,
entity telefragger,
vector telefragmin,
vector telefragmax )

Definition at line 42 of file teleporters.qc.

43{
44 TDEATHLOOP(player.origin)
45 {
46 if (IS_PLAYER(player) && GetResource(player, RES_HEALTH) >= 1)
47 {
48 if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
49 {
50 if(IS_PLAYER(head))
51 if(GetResource(head, RES_HEALTH) >= 1)
52 ++tdeath_hit;
53 Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, DMG_NOWEP, head.origin, '0 0 0');
54 }
55 }
56 else // dead bodies and monsters gib themselves instead of telefragging
57 Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, DMG_NOWEP, telefragger.origin, '0 0 0');
58 }
59}
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:503
#define DMG_NOWEP
Definition damage.qh:104
float tdeath_hit

References autocvar_g_telefrags_teamplay, Damage(), DMG_NOWEP, entity(), GetResource(), IS_PLAYER, tdeath_hit, TDEATHLOOP, teamplay, and vector.

Referenced by spawn_tdeath(), and TeleportPlayer().

◆ Teleport_Find()

entity Teleport_Find ( vector mi,
vector ma )

Definition at line 294 of file teleporters.qc.

295{
297 {
298 return it;
299 });
300 return NULL;
301}
#define IL_EACH(this, cond, body)
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
Definition common.qc:133

References entity(), g_teleporters, IL_EACH, NULL, vector, and WarpZoneLib_BoxTouchesBrush().

Referenced by WarpZone_StartFrame().

◆ teleport_findtarget()

void teleport_findtarget ( entity this)

Definition at line 246 of file teleporters.qc.

247{
248 bool istrigger = (this.solid == SOLID_TRIGGER);
249
250 int n = 0;
251 for(entity e = NULL; (e = find(e, targetname, this.target)); )
252 {
253 ++n;
254#ifdef SVQC
255 if(e.move_movetype == MOVETYPE_NONE)
256 {
257 entity tracetest_ent = spawn();
258 setsize(tracetest_ent, PL_MIN_CONST, PL_MAX_CONST);
259 tracetest_ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
260 waypoint_spawnforteleporter(this, e.origin, 0, tracetest_ent);
261 delete(tracetest_ent);
262 }
263 if(e.classname != "info_teleport_destination")
264 LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.");
265#endif
266 }
267
268 if(n == 0)
269 {
270 // no dest!
271 objerror (this, "Teleporter with nonexistent target");
272 return;
273 }
274 else if(n == 1)
275 {
276 // exactly one dest - bots love that
277 this.enemy = find(NULL, targetname, this.target);
278 }
279 else
280 {
281 // have to use random selection every single time
282 this.enemy = NULL;
283 }
284
285 // now enable touch
286 if(istrigger)
288#ifdef SVQC
289 if(istrigger)
291#endif
292}
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)
const vector PL_MIN_CONST
Definition constants.qh:56
const vector PL_MAX_CONST
Definition constants.qh:55
float DPCONTENTS_BOTCLIP
const float SOLID_TRIGGER
float DPCONTENTS_SOLID
float DPCONTENTS_BODY
float DPCONTENTS_PLAYERCLIP
#define spawn
solid
Definition ent_cs.qc:165
entity find(entity start,.string field, string match)
const int MOVETYPE_NONE
Definition movetypes.qh:129
#define objerror
Definition pre.qh:8
#define settouch(e, f)
Definition self.qh:73
entity enemy
Definition sv_ctf.qh:153
void trigger_teleport_link(entity this)
Definition teleport.qc:115
void Teleport_Touch(entity this, entity toucher)
Definition teleport.qc:49
string target
Definition triggers.qh:55

References DPCONTENTS_BODY, DPCONTENTS_BOTCLIP, DPCONTENTS_PLAYERCLIP, DPCONTENTS_SOLID, enemy, entity(), find(), LOG_INFO, MOVETYPE_NONE, NULL, objerror, PL_MAX_CONST, PL_MIN_CONST, settouch, solid, SOLID_TRIGGER, spawn, target, targetname, Teleport_Touch(), trigger_teleport_link(), and waypoint_spawnforteleporter().

Referenced by CheatCommand(), spawnfunc(), and target_teleporter_checktarget().

◆ Teleport_Touch()

void Teleport_Touch ( entity this,
entity toucher )

Definition at line 49 of file teleport.qc.

50{
51 entity player = toucher;
52
53 if(!Teleport_Active(this, player))
54 return;
55
56 EXACTTRIGGER_TOUCH(this, player);
57
58#ifdef SVQC
59 if(IS_PLAYER(player))
61#endif
62
63 entity e;
64 e = Simple_TeleportPlayer(this, player);
65
66#ifdef SVQC
67 string s = this.target; this.target = string_null;
68 SUB_UseTargets(this, player, player); // TODO: should we be using toucher for trigger too?
69 if (!this.target) this.target = s;
70
71 SUB_UseTargets(e, player, player);
72#endif
73}
void SUB_UseTargets(entity this, entity actor, entity trigger)
Definition triggers.qc:344
#define EXACTTRIGGER_TOUCH(e, t)
Definition common.qh:115
string string_null
Definition nil.qh:9
entity entity toucher
Definition self.qh:72
void RemoveGrapplingHooks(entity pl)
Definition hook.qc:30
bool Teleport_Active(entity this, entity player)
Definition teleport.qc:15
entity Simple_TeleportPlayer(entity teleporter, entity player)

References entity(), EXACTTRIGGER_TOUCH, IS_PLAYER, RemoveGrapplingHooks(), Simple_TeleportPlayer(), string_null, SUB_UseTargets(), target, Teleport_Active(), and toucher.

Referenced by teleport_findtarget().

◆ TeleportPlayer()

void TeleportPlayer ( entity teleporter,
entity player,
vector to,
vector to_angles,
vector to_velocity,
vector telefragmin,
vector telefragmax,
float tflags )

Definition at line 67 of file teleporters.qc.

68{
69 entity telefragger;
70 vector from;
71
72 if(teleporter.owner)
73 telefragger = teleporter.owner;
74 else
75 telefragger = player;
76
77 makevectors (to_angles);
78
79#ifdef SVQC
80 if(player.teleportable == TELEPORT_NORMAL) // don't play sounds or show particles for anything that isn't a player, maybe change later to block only observers
81 {
82 if(teleporter.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
83 {
84 if(tflags & TELEPORT_FLAG_SOUND)
85 {
86 string thesound = SND(TELEPORT);
87 if(teleporter.noise != "")
88 {
90 FOREACH_WORD(teleporter.noise, true,
91 {
92 RandomSelection_AddString(it, 1, 1);
93 });
95 }
96 _sound (player, CH_TRIGGER, thesound, VOL_BASE, ATTEN_NORM);
97 }
98 if(tflags & TELEPORT_FLAG_PARTICLES)
99 {
100 Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1);
101 Send_Effect(EFFECT_TELEPORT, to + v_forward * 32, '0 0 0', 1);
102 }
103 teleporter.pushltime = time + 0.2;
104 }
105 }
106#endif
107
108 // Relocate the player
109 // assuming to allows PL_MIN to PL_MAX box and some more
110#ifdef SVQC
111 from = player.origin;
112 setorigin(player, to);
113 player.oldorigin = to; // don't undo the teleport by unsticking
114 player.angles = to_angles;
115 if (IS_BOT_CLIENT(player))
116 {
117 player.v_angle = player.angles;
118 bot_aim_reset(player);
119 }
120 player.fixangle = true;
121 player.velocity = to_velocity;
122 BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
123
124 makevectors(player.angles);
125 Reset_ArcBeam(player, v_forward);
128#elif defined(CSQC)
129 from = player.origin;
130 setorigin(player, to);
131 player.angles = to_angles;
132 player.velocity = to_velocity;
133 UNSET_ONGROUND(player);
134 player.iflags |= IFLAG_TELEPORTED | IFLAG_V_ANGLE | IFLAG_ANGLES;
135 player.csqcmodel_teleported = 1;
136 player.v_angle = to_angles;
137
138 if(player == csqcplayer) // not for anything but the main player
139 {
140 setproperty(VF_ANGLES, player.angles);
141 setproperty(VF_CL_VIEWANGLES, player.angles);
142 }
143#endif
144
145#ifdef SVQC
146 if(IS_PLAYER(player))
147 {
148 if((tflags & TELEPORT_FLAG_TDEATH) && player.takedamage && !IS_DEAD(player)
151 {
152 tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
153 }
154
155 // player no longer is on ground
156 UNSET_ONGROUND(player);
157
158 // reset tracking of oldvelocity for impact damage (sudden velocity changes)
159 player.oldvelocity = player.velocity;
160
161 // reset tracking of who pushed you into a hazard (for kill credit)
162 if(teleporter.owner)
163 {
164 player.pusher = teleporter.owner;
165 player.pushltime = time + autocvar_g_maxpushtime;
166 player.istypefrag = PHYS_INPUT_BUTTON_CHAT(player);
167 }
168 else
169 {
170 player.pushltime = 0;
171 player.istypefrag = 0;
172 }
173
174 player.lastteleporttime = time;
175 player.lastteleport_origin = from;
176 }
177#endif
178}
void bot_aim_reset(entity this)
Definition aim.qc:134
entity csqcplayer
Definition cl_player.qh:26
#define g_race
Definition race.qh:48
#define PHYS_INPUT_BUTTON_CHAT(s)
Definition player.qh:159
const float VF_CL_VIEWANGLES
const float VF_ANGLES
void Reset_ArcBeam()
Definition arc.qc:852
const int EF_TELEPORT_BIT
void UpdateCSQCProjectileAfterTeleport(entity e)
#define g_cts
Definition cts.qh:36
float autocvar_g_maxpushtime
Definition damage.qh:17
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:124
const int IFLAG_V_ANGLE
const int IFLAG_ANGLES
const int IFLAG_TELEPORTED
#define FOREACH_WORD(words, cond, body)
Definition iter.qh:33
#define BITXOR_ASSIGN(a, b)
Definition common.qh:107
#define UNSET_ONGROUND(s)
Definition movetypes.qh:18
string RandomSelection_chosen_string
Definition random.qh:7
#define round_handler_IsActive()
#define round_handler_IsRoundStarted()
void UpdateItemAfterTeleport(entity this)
Definition items.qc:107
const int CH_TRIGGER
Definition sound.qh:12
const float VOL_BASE
Definition sound.qh:36
#define _sound(e, c, s, v, a)
Definition sound.qh:43
const float ATTEN_NORM
Definition sound.qh:30
#define SND(id)
Definition all.qh:35
const int TELEPORT_FLAG_SOUND
const int TELEPORT_FLAG_PARTICLES
const int TELEPORT_FLAG_TDEATH
const int TELEPORT_NORMAL
const int TELEPORT_FLAG_FORCE_TDEATH
bool autocvar_g_telefrags
Definition teleporters.qh:5
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition utils.qh:15

References _sound, ATTEN_NORM, autocvar_g_maxpushtime, autocvar_g_telefrags, BITXOR_ASSIGN, bot_aim_reset(), CH_TRIGGER, csqcplayer, EF_TELEPORT_BIT, entity(), FOREACH_WORD, g_cts, g_race, IFLAG_ANGLES, IFLAG_TELEPORTED, IFLAG_V_ANGLE, IS_BOT_CLIENT, IS_DEAD, IS_PLAYER, makevectors, PHYS_INPUT_BUTTON_CHAT, RandomSelection_chosen_string, RandomSelection_Init(), Reset_ArcBeam(), round_handler_IsActive, round_handler_IsRoundStarted, Send_Effect(), SND, tdeath(), TELEPORT_FLAG_FORCE_TDEATH, TELEPORT_FLAG_PARTICLES, TELEPORT_FLAG_SOUND, TELEPORT_FLAG_TDEATH, TELEPORT_NORMAL, time, UNSET_ONGROUND, UpdateCSQCProjectileAfterTeleport(), UpdateItemAfterTeleport(), v_forward, vector, VF_ANGLES, VF_CL_VIEWANGLES, and VOL_BASE.

Referenced by nade_translocate_boom(), and Portal_TeleportPlayer().

◆ trigger_teleport_use()

void trigger_teleport_use ( entity this,
entity actor,
entity trigger )

Definition at line 5 of file teleport.qc.

6{
7 if(teamplay)
8 this.team = actor.team;
9#ifdef SVQC
11#endif
12}
int team
Definition main.qh:188
const int SF_TRIGGER_UPDATE
Definition defs.qh:23
int SendFlags
Definition net.qh:118

References entity(), SendFlags, SF_TRIGGER_UPDATE, team, and teamplay.

Referenced by spawnfunc().

◆ WarpZone_PostTeleportPlayer_Callback()

void WarpZone_PostTeleportPlayer_Callback ( entity pl)

Definition at line 303 of file teleporters.qc.

304{
305#ifdef SVQC
306 makevectors(pl.angles);
310 if (IS_PLAYER(pl)) anticheat_fixangle(pl);
311#endif
312 // "disown" projectiles after teleport
313 if(pl.owner)
314 if(pl.owner == pl.realowner)
315 {
316 #ifdef SVQC
317 if(!(pl.flags & FL_PROJECTILE))
318 #elif defined(CSQC)
319 if(!(pl.flags & BIT(15))) // FL_PROJECTILE
320 #endif
321 LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".");
322 pl.owner = NULL;
323 }
324 if(IS_PLAYER(pl))
325 {
326 // reset tracking of oldvelocity for impact damage (sudden velocity changes)
327 #ifdef SVQC
328 pl.oldvelocity = pl.velocity;
329 #endif
330 }
331}
void anticheat_fixangle(entity this)
Definition anticheat.qc:245
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
const int FL_PROJECTILE
Definition constants.qh:85

Variable Documentation

◆ autocvar_g_telefrags

bool autocvar_g_telefrags

Definition at line 5 of file teleporters.qh.

Referenced by TeleportPlayer().

◆ autocvar_g_telefrags_avoid

bool autocvar_g_telefrags_avoid

Definition at line 6 of file teleporters.qh.

◆ autocvar_g_telefrags_teamplay

bool autocvar_g_telefrags_teamplay

Definition at line 7 of file teleporters.qh.

Referenced by check_tdeath(), and tdeath().

◆ g_teleporters

IntrusiveList g_teleporters

Definition at line 10 of file teleporters.qh.

Referenced by havocbot_moveto(), spawnfunc(), STATIC_INIT(), and Teleport_Find().

◆ pusher

entity pusher

Definition at line 13 of file teleporters.qh.

◆ realowner

entity realowner

Definition at line 72 of file teleporters.qh.

Referenced by bumble_raygun_send(), CSQCProjectile_SendEntity(), func_breakable_damage(), GrapplingHook_Damage(), GrapplingHookSend(), GrapplingHookThink(), M_Golem_Attack_Lightning_Explode(), M_Mage_Attack_Spike_Explode(), M_Spider_Attack_Web_Explode(), M_Wyvern_Attack_Fireball_Explode(), monster_setupcolors(), nade_ammo_boom(), nade_ammo_touch(), nade_boom(), nade_damage(), nade_darkness_boom(), nade_darkness_think(), nade_entrap_boom(), nade_entrap_touch(), nade_heal_boom(), nade_heal_touch(), nade_ice_boom(), nade_ice_think(), nade_monster_boom(), nade_napalm_ball(), nade_napalm_boom(), nade_normal_boom(), nade_spawn_boom(), nade_spawn_DestroyDamage(), nade_touch(), nade_translocate_boom(), nade_translocate_DestroyDamage(), nade_veil_boom(), nade_veil_touch(), napalm_damage(), pong_paddle_think(), race_waypointsprite_visible_for_player(), racer_rocket_groundhugger(), racer_rocket_tracker(), raptor_bomb_burst(), raptor_bomblet_boom(), RemoveHook(), sandbox_ObjectFunction_Think(), spiderbot_rocket_guided(), turret_flac_projectile_think_explode(), turret_projectile_explode(), vehicles_projectile_explode(), W_Arc_Bolt_Explode(), W_Arc_Bolt_Touch(), W_Blaster_Touch(), W_Crylink_Touch(), W_Devastator_DoRemoteExplode(), W_Devastator_Explode(), W_Devastator_RemoteExplode(), W_Devastator_Think(), W_Devastator_Unregister(), W_Electro_Bolt_Think(), W_Electro_Explode(), W_Electro_ExplodeCombo(), W_Electro_ExplodeComboThink(), W_Electro_Orb_Damage(), W_Electro_Orb_ExplodeOverTime(), W_Electro_Orb_Stick(), W_Fireball_Explode(), W_Fireball_Firemine_Touch(), W_Fireball_LaserPlay(), W_Hagar_Explode(), W_Hagar_Explode2(), W_HLAC_Touch(), W_Hook_Damage(), W_Hook_ExplodeThink(), W_MineLayer_Damage(), W_MineLayer_DoRemoteExplode(), W_MineLayer_Explode(), W_MineLayer_ProximityExplode(), W_MineLayer_RemoteExplode(), W_MineLayer_Stick(), W_MineLayer_Think(), W_Mortar_Grenade_Explode(), W_Mortar_Grenade_Explode2(), W_MuzzleFlash_Model_Think(), W_OverkillRocketPropelledChainsaw_Explode(), W_OverkillRocketPropelledChainsaw_Think(), W_Porto_Fail(), W_Porto_Success(), W_Porto_Think(), W_Porto_Touch(), W_PrepareExplosionByDamage(), W_RocketMinsta_Laser_Damage(), W_RocketMinsta_Laser_Explode(), W_Seeker_Flac_Explode(), W_Seeker_Missile_Damage(), W_Seeker_Missile_Explode(), W_Seeker_Tag_Touch(), W_Seeker_Tracker_Think(), W_Seeker_Vollycontroller_Think(), W_Shotgun_Melee_Think(), W_Tuba_NoteSendEntity(), W_Tuba_NoteThink(), and write_damagetext().

◆ tdeath_hit

float tdeath_hit

Definition at line 60 of file teleporters.qh.

Referenced by Portal_TeleportPlayer(), and tdeath().

◆ TELEPORT_FLAG_FORCE_TDEATH

const int TELEPORT_FLAG_FORCE_TDEATH = BIT(3)

Definition at line 18 of file teleporters.qh.

Referenced by TeleportPlayer().

◆ TELEPORT_FLAG_PARTICLES

const int TELEPORT_FLAG_PARTICLES = BIT(1)

Definition at line 16 of file teleporters.qh.

Referenced by TeleportPlayer().

◆ TELEPORT_FLAG_SOUND

const int TELEPORT_FLAG_SOUND = BIT(0)

Definition at line 15 of file teleporters.qh.

Referenced by TeleportPlayer().

◆ TELEPORT_FLAG_TDEATH

const int TELEPORT_FLAG_TDEATH = BIT(2)

Definition at line 17 of file teleporters.qh.

Referenced by TeleportPlayer().

◆ TELEPORT_NORMAL

const int TELEPORT_NORMAL = 1

◆ TELEPORT_SIMPLE

const int TELEPORT_SIMPLE = 2

Definition at line 27 of file teleporters.qh.

Referenced by PlayerDamage(), and PutObserverInServer().

◆ teleportable