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

Go to the source code of this file.

Macros

#define PUSH_VELOCITY_ADD_XY   BIT(1)
#define PUSH_VELOCITY_ADD_Z   BIT(3)
#define PUSH_VELOCITY_BIDIRECTIONAL_XY   BIT(4)
#define PUSH_VELOCITY_BIDIRECTIONAL_Z   BIT(5)
#define PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS   BIT(6)
#define PUSH_VELOCITY_PLAYERDIR_XY   BIT(0)
#define PUSH_VELOCITY_PLAYERDIR_Z   BIT(2)
#define Q3_TARGET_PUSH_JUMPPAD   BIT(0)

Functions

 spawnfunc (info_notnull)
 spawnfunc (target_position)
 spawnfunc (target_push)
 spawnfunc (trigger_push)
 spawnfunc (trigger_push_velocity)
 STATIC_INIT (g_jumppads)
void SUB_UseTargets (entity this, entity actor, entity trigger)
vector trigger_push_calculatevelocity (vector org, entity tgt, float ht, entity pushed_entity)
void trigger_push_findtarget (entity this)
bool trigger_push_test (entity this, entity item)
bool trigger_push_testorigin (entity tracetest_ent, entity targ, entity jp, vector org)
bool trigger_push_testorigin_for_item (entity tracetest_ent, entity item, vector org)
void trigger_push_touch (entity this, entity toucher)
void trigger_push_use (entity this, entity actor, entity trigger)

Variables

vector dest
IntrusiveList g_jumppads
float height
bool istypefrag
float jumppadcount
entity jumppadsused [NUM_JUMPPADSUSED]
entity last_pushed
const int NUM_JUMPPADSUSED = 3
const int PUSH_ONCE = BIT(0)
const int PUSH_SILENT = BIT(1)
const int PUSH_STATIC = BIT(12)
float pushltime

Macro Definition Documentation

◆ PUSH_VELOCITY_ADD_XY

#define PUSH_VELOCITY_ADD_XY   BIT(1)

Definition at line 9 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ PUSH_VELOCITY_ADD_Z

#define PUSH_VELOCITY_ADD_Z   BIT(3)

Definition at line 11 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ PUSH_VELOCITY_BIDIRECTIONAL_XY

#define PUSH_VELOCITY_BIDIRECTIONAL_XY   BIT(4)

Definition at line 12 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ PUSH_VELOCITY_BIDIRECTIONAL_Z

#define PUSH_VELOCITY_BIDIRECTIONAL_Z   BIT(5)

Definition at line 13 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS

#define PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS   BIT(6)

Definition at line 14 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ PUSH_VELOCITY_PLAYERDIR_XY

#define PUSH_VELOCITY_PLAYERDIR_XY   BIT(0)

Definition at line 8 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ PUSH_VELOCITY_PLAYERDIR_Z

#define PUSH_VELOCITY_PLAYERDIR_Z   BIT(2)

Definition at line 10 of file jumppads.qh.

Referenced by trigger_push_velocity_calculatevelocity().

◆ Q3_TARGET_PUSH_JUMPPAD

#define Q3_TARGET_PUSH_JUMPPAD   BIT(0)

Definition at line 16 of file jumppads.qh.

Referenced by spawnfunc().

Function Documentation

◆ spawnfunc() [1/5]

spawnfunc ( info_notnull )

Definition at line 967 of file jumppads.qc.

968{
969 target_push_init(this);
970}
void target_push_init(entity this)
Definition jumppads.qc:924

References target_push_init().

◆ spawnfunc() [2/5]

spawnfunc ( target_position )

Definition at line 971 of file jumppads.qc.

972{
973 target_push_init(this);
974}

References target_push_init().

◆ spawnfunc() [3/5]

spawnfunc ( target_push )

Definition at line 931 of file jumppads.qc.

932{
933 target_push_init(this); // normal push target behaviour can be combined with a legacy pusher?
934 this.use = target_push_use;
935
936 if(this.target && this.target != "") // Q3 or old style Nexuiz pusher
937 {
938 for (entity trigger_ent = findchain(target, this.targetname); trigger_ent; trigger_ent = trigger_ent.chain)
939 {
940 // add the triggering entity to the g_jumppads list
941 // multiple jump pads can use the same target_push
942 if(!IL_CONTAINS(g_jumppads, trigger_ent))
943 {
944 IL_PUSH(g_jumppads, trigger_ent);
946 }
947 }
948 }
949 else // Q3 .angles and .speed pusher
950 {
951 if (!this.speed)
952 this.speed = 1000;
953 SetMovedir(this); // this clears .angles so it must be after target_push_init()
954 this.movedir *= this.speed;
955 }
956
957 if (!this.noise)
958 {
960 this.noise = "sound/misc/windfly.wav"; // Q3 mappers provide this, it's not in pak0
961 else
962 this.noise = "misc/jumppad.wav";
963 }
964 precache_sound (this.noise);
965}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int spawnflags
Definition ammo.qh:15
#define Q3COMPAT_COMMON
Definition stats.qh:370
const int INITPRIO_FINDTARGET
Definition constants.qh:96
#define use
float speed
Definition dynlight.qc:9
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
ERASEABLE bool IL_CONTAINS(IntrusiveList this, entity it)
void trigger_push_findtarget(entity this)
Definition jumppads.qc:783
void target_push_use(entity this, entity actor, entity trigger)
Definition jumppads.qc:909
#define Q3_TARGET_PUSH_JUMPPAD
Definition jumppads.qh:16
IntrusiveList g_jumppads
Definition jumppads.qh:18
vector movedir
Definition viewloc.qh:18
string precache_sound(string sample)
void SetMovedir(entity this)
Definition subs.qc:539
string noise
Definition subs.qh:83
string targetname
Definition triggers.qh:56
string target
Definition triggers.qh:55
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2230

References entity(), g_jumppads, IL_CONTAINS(), IL_PUSH(), InitializeEntity(), INITPRIO_FINDTARGET, movedir, noise, precache_sound(), Q3_TARGET_PUSH_JUMPPAD, Q3COMPAT_COMMON, SetMovedir(), spawnflags, speed, target, target_push_init(), target_push_use(), targetname, trigger_push_findtarget(), and use.

◆ spawnfunc() [4/5]

spawnfunc ( trigger_push )

Definition at line 845 of file jumppads.qc.

846{
847 SetMovedir(this);
848
851 this.active = ACTIVE_ACTIVE;
852 this.use = trigger_push_use;
854
855 // normal push setup
856 if (!this.speed)
857 this.speed = 1000;
858 this.movedir *= this.speed * 10;
859
860 if (!this.noise)
861 this.noise = "misc/jumppad.wav";
862 precache_sound (this.noise);
863
864 trigger_push_link(this); // link it now
865
866 IL_PUSH(g_jumppads, this);
867
868 // this must be called to spawn the teleport waypoints for bots
870}
float effects
const float EF_NODEPTHTEST
int active
Definition defs.qh:34
const int ACTIVE_ACTIVE
Definition defs.qh:37
void trigger_push_use(entity this, entity actor, entity trigger)
Definition jumppads.qc:6
void trigger_push_link(entity this)
Definition jumppads.qc:823
void trigger_push_touch(entity this, entity toucher)
Definition jumppads.qc:437
#define BITSET_ASSIGN(a, b)
Definition common.qh:104
#define settouch(e, f)
Definition self.qh:73
void WarpZoneLib_ExactTrigger_Init(entity this, bool unsetmodel)

References active, ACTIVE_ACTIVE, BITSET_ASSIGN, EF_NODEPTHTEST, effects, g_jumppads, IL_PUSH(), InitializeEntity(), INITPRIO_FINDTARGET, movedir, noise, precache_sound(), SetMovedir(), settouch, speed, trigger_push_findtarget(), trigger_push_link(), trigger_push_touch(), trigger_push_use(), use, and WarpZoneLib_ExactTrigger_Init().

◆ spawnfunc() [5/5]

spawnfunc ( trigger_push_velocity )

Definition at line 879 of file jumppads.qc.

880{
883 this.active = ACTIVE_ACTIVE;
884 this.use = trigger_push_use;
886
887 // normal push setup
888 if (!this.noise)
889 this.noise = "misc/jumppad.wav";
890 precache_sound (this.noise);
891
892 trigger_push_velocity_link(this); // link it now
893}
void trigger_push_velocity_link(entity this)
Definition jumppads.qc:828
void trigger_push_velocity_touch(entity this, entity toucher)
Definition jumppads.qc:460

References active, ACTIVE_ACTIVE, BITSET_ASSIGN, EF_NODEPTHTEST, effects, noise, precache_sound(), settouch, trigger_push_use(), trigger_push_velocity_link(), trigger_push_velocity_touch(), use, and WarpZoneLib_ExactTrigger_Init().

◆ STATIC_INIT()

STATIC_INIT ( g_jumppads )

Definition at line 19 of file jumppads.qh.

19{ g_jumppads = IL_NEW(); }
#define IL_NEW()

References g_jumppads, and IL_NEW.

◆ SUB_UseTargets()

◆ trigger_push_calculatevelocity()

vector trigger_push_calculatevelocity ( vector org,
entity tgt,
float ht,
entity pushed_entity )

Definition at line 32 of file jumppads.qc.

33{
34 float grav, sdist, zdist, vs, vz, jumpheight;
35 vector sdir, torg;
36
37 torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
38
39 grav = PHYS_GRAVITY(pushed_entity);
40 if(pushed_entity && pushed_entity.gravity)
41 grav *= pushed_entity.gravity;
42
43 // Q3 has frametime-dependent gravity, but its trigger_push velocity calculation doesn't account for that.
44 // This discrepancy can be simulated accurately which ensures that all entities will arrive
45 // where they would in Q3 with gravity 800 at 125fps, even if entity-specific gravity is applied.
46 // This can be hard-coded because we don't support the Q3 world.gravity field at this time.
47 // See physicsCPMA.cfg for maths and test results.
49 grav /= 750/800; // exact float, unlike 800/750
50
51 zdist = torg.z - org.z;
52 sdist = vlen(torg - org - zdist * '0 0 1');
53 sdir = normalize(torg - org - zdist * '0 0 1');
54
55 // how high do we need to push the player?
56 jumpheight = fabs(ht);
57 if(zdist > 0)
58 jumpheight += zdist;
59
60 /*
61 STOP.
62
63 You will not understand the following equations anyway...
64 But here is what I did to get them.
65
66 I used the functions
67
68 s(t) = t * vs
69 z(t) = t * vz - 1/2 grav t^2
70
71 and solved for:
72
73 s(ti) = sdist
74 z(ti) = zdist
75 max(z, ti) = jumpheight
76
77 From these three equations, you will find the three parameters vs, vz
78 and ti.
79 */
80
81 // push them so high...
82 vz = sqrt(fabs(2 * grav * jumpheight)); // NOTE: sqrt(positive)!
83
84 // we start with downwards velocity only if it's a downjump and the jump apex should be outside the jump!
85 if(ht < 0)
86 if(zdist < 0)
87 vz = -vz;
88
89 vector solution = solve_quadratic(0.5 * grav, -vz, zdist); // equation "z(ti) = zdist"
90 // ALWAYS solvable because jumpheight >= zdist
91 if(!solution.z)
92 solution_y = solution.x; // just in case it is not solvable due to roundoff errors, assume two equal solutions at their center (this is mainly for the usual case with ht == 0)
93 if(zdist == 0)
94 solution_x = solution.y; // solution_x is 0 in this case, so don't use it, but rather use solution_y (which will be sqrt(0.5 * jumpheight / grav), actually)
95
96 float flighttime;
97 if(zdist < 0)
98 {
99 // down-jump
100 if(ht < 0)
101 {
102 // almost straight line type
103 // jump apex is before the jump
104 // we must take the larger one
105 flighttime = solution.y;
106 }
107 else
108 {
109 // regular jump
110 // jump apex is during the jump
111 // we must take the larger one too
112 flighttime = solution.y;
113 }
114 }
115 else
116 {
117 // up-jump
118 if(ht < 0)
119 {
120 // almost straight line type
121 // jump apex is after the jump
122 // we must take the smaller one
123 flighttime = solution.x;
124 }
125 else
126 {
127 // regular jump
128 // jump apex is during the jump
129 // we must take the larger one
130 flighttime = solution.y;
131 }
132 }
133 vs = sdist / flighttime;
134
135 // finally calculate the velocity
136 return sdir * vs + '0 0 1' * vz;
137}
ERASEABLE vector solve_quadratic(float a, float b, float c)
ax^2 + bx + c = 0
Definition math.qh:304
float vlen(vector v)
float sqrt(float f)
vector normalize(vector v)
float fabs(float f)
#define PHYS_GRAVITY(s)
Definition movetypes.qh:53
vector
Definition self.qh:92
vector org
Definition self.qh:92

Referenced by jumppad_push(), trigger_push_get_push_time(), trigger_push_test(), and trigger_push_velocity_calculatevelocity().

◆ trigger_push_findtarget()

void trigger_push_findtarget ( entity this)

Definition at line 783 of file jumppads.qc.

784{
785 trigger_push_test(this, NULL);
786}
bool trigger_push_test(entity this, entity item)
Definition jumppads.qc:606
#define NULL
Definition post.qh:14

References entity(), NULL, and trigger_push_test().

Referenced by spawnfunc(), and spawnfunc().

◆ trigger_push_test()

bool trigger_push_test ( entity this,
entity item )

Definition at line 606 of file jumppads.qc.

607{
608#ifdef SVQC
610 entity pusher = get_pusher_from_trigger(this); // function might get called from a non-push trigger entity
611#elif defined(CSQC)
612 entity pusher = this; // client-side code never calls this on a non-push entity
613#endif
614
615 if (pusher.target)
616 {
617 int n = 0;
618#ifdef SVQC
619 vector vel = '0 0 0';
620#endif
621 for(entity t = NULL; (t = find(t, targetname, pusher.target)); )
622 {
623 ++n;
624#ifdef SVQC
625 if(t.move_movetype != MOVETYPE_NONE)
626 continue;
627
628 // bots can't tell teamed jumppads from normal ones
629 if (this.team)
630 continue;
631
632 entity e = spawn();
633 setsize(e, PL_MIN_CONST, PL_MAX_CONST);
635 e.velocity = trigger_push_calculatevelocity(org, t, pusher.height, e);
636
637 vel = e.velocity;
638 vector best_target = '0 0 0';
639 vector best_org = '0 0 0';
640 vector best_vel = '0 0 0';
641 bool valid_best_target = false;
642 if (item)
643 {
645 {
646 delete(e);
647 return false;
648 }
649 }
650 else
651 {
652 // optimization: if horizontal velocity is 0 then target is not good since the trajectory
653 // will definitely go back to the jumppad (horizontal velocity of best_vel can't be 0 anyway)
654 if ((e.velocity.x != 0 || e.velocity.y != 0)
656 {
657 best_target = trace_endpos;
658 best_org = org;
659 best_vel = e.velocity;
660 valid_best_target = true;
661 }
662 }
663
664 vector new_org;
665 vector dist = t.origin - org;
666 if (dist.x || dist.y) // if not perfectly vertical
667 {
668 // test trajectory with different starting points, sometimes the trajectory
669 // starting from the jumppad origin can't reach the real destination
670 // and destination waypoint ends up near the jumppad itself
671 vector flatdir = normalize(dist - eZ * dist.z);
672 vector ofs = flatdir * 0.5 * min(fabs(this.absmax.x - this.absmin.x), fabs(this.absmax.y - this.absmin.y));
673 new_org = org + ofs;
674
675 LABEL(new_test)
676 e.velocity = trigger_push_calculatevelocity(new_org, t, pusher.height, e);
677 if (item)
678 {
679 if (!trigger_push_testorigin_for_item(e, item, new_org))
680 {
681 delete(e);
682 return false;
683 }
684 }
685 else
686 {
687 vel = e.velocity;
688 if (vdist(vec2(e.velocity), <, autocvar_sv_maxspeed))
689 e.velocity = autocvar_sv_maxspeed * flatdir;
690 if (trigger_push_testorigin(e, t, pusher, new_org) && (!valid_best_target || trace_endpos.z > best_target.z + 50))
691 {
692 best_target = trace_endpos;
693 best_org = new_org;
694 best_vel = vel;
695 valid_best_target = true;
696 }
697 }
698 if (ofs && new_org != org - ofs)
699 {
700 new_org = org - ofs;
701 goto new_test;
702 }
703 }
704
705 if (item)
706 {
707 delete(e);
708 return true;
709 }
710
711 if (valid_best_target)
712 {
713 if (!(boxesoverlap(this.absmin, this.absmax + eZ * 50, best_target + PL_MIN_CONST, best_target + PL_MAX_CONST)))
714 {
715 float velxy = vlen(vec2(best_vel));
716 float cost = vlen(vec2(t.origin - best_org)) / velxy;
717 if(velxy < autocvar_sv_maxspeed)
718 velxy = autocvar_sv_maxspeed;
719 cost += vlen(vec2(best_target - t.origin)) / velxy;
720 waypoint_spawnforteleporter(this, best_target, cost, e);
721 }
722 }
723 delete(e);
724#endif
725 }
726
727 if(item)
728 return false;
729
730 if(!n)
731 {
732 // no dest!
733#ifdef SVQC
734 objerror (this, "Jumppad with nonexistant target");
735#endif
736 return false;
737 }
738 else if(n == 1)
739 {
740 // exactly one dest - bots love that
741 if (!this.team)
742 pusher.enemy = find(NULL, targetname, pusher.target);
743 else // bots can't tell teamed jumppads from normal ones
744 pusher.enemy = NULL;
745 }
746 else
747 {
748 // have to use random selection every single time
749 pusher.enemy = NULL;
750 }
751
752 }
753#ifdef SVQC
754 else
755 {
756 if (!this.team)
757 {
758 entity e = spawn();
759 setsize(e, PL_MIN_CONST, PL_MAX_CONST);
761 setorigin(e, org);
762 e.velocity = pusher.movedir;
763 tracetoss(e, e);
764 if (item)
765 {
766 bool r = (trace_ent == item);
767 delete(e);
768 return r;
769 }
772 delete(e);
773 }
774 else if (item)
775 return false;
776 }
777
779#endif
780 return true;
781}
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken, entity tracetest_ent)
int team
Definition main.qh:188
float autocvar_sv_maxspeed
Definition player.qh:53
#define LABEL(id)
Definition compiler.qh:34
const vector PL_MIN_CONST
Definition constants.qh:56
const vector PL_MAX_CONST
Definition constants.qh:55
entity trace_ent
float DPCONTENTS_BOTCLIP
float DPCONTENTS_SOLID
float DPCONTENTS_BODY
float DPCONTENTS_PLAYERCLIP
vector trace_endpos
vector absmax
vector absmin
#define spawn
void defer(entity this, float fdelay, void(entity) func)
Execute func() after time + fdelay.
Definition defer.qh:29
vector trigger_push_get_start_point(entity this)
Definition jumppads.qc:559
bool trigger_push_testorigin(entity tracetest_ent, entity targ, entity jp, vector org)
Definition jumppads.qc:476
bool trigger_push_testorigin_for_item(entity tracetest_ent, entity item, vector org)
Definition jumppads.qc:512
entity get_pusher_from_trigger(entity this)
Definition jumppads.qc:533
vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity)
Definition jumppads.qc:32
void trigger_push_updatelink(entity this)
Definition jumppads.qc:818
entity pusher
Definition laser.qc:57
entity find(entity start,.string field, string match)
float min(float f,...)
const int MOVETYPE_NONE
Definition movetypes.qh:129
#define objerror
Definition pre.qh:8
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
const vector eZ
Definition vector.qh:46
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
#define vec2(...)
Definition vector.qh:90

References absmax, absmin, autocvar_sv_maxspeed, boxesoverlap(), defer(), DPCONTENTS_BODY, DPCONTENTS_BOTCLIP, DPCONTENTS_PLAYERCLIP, DPCONTENTS_SOLID, entity(), eZ, fabs(), find(), get_pusher_from_trigger(), LABEL, min(), MOVETYPE_NONE, normalize(), NULL, objerror, org, PL_MAX_CONST, PL_MIN_CONST, pusher, spawn, targetname, team, trace_endpos, trace_ent, trigger_push_calculatevelocity(), trigger_push_get_start_point(), trigger_push_testorigin(), trigger_push_testorigin_for_item(), trigger_push_updatelink(), vdist, vec2, vector, vlen(), and waypoint_spawnforteleporter().

Referenced by trigger_push_findtarget().

◆ trigger_push_testorigin()

bool trigger_push_testorigin ( entity tracetest_ent,
entity targ,
entity jp,
vector org )

Definition at line 476 of file jumppads.qc.

477{
478 setorigin(tracetest_ent, org);
479 tracetoss(tracetest_ent, tracetest_ent);
481 return false;
482
483 if (!jp.height)
484 {
485 // since tracetoss starting from jumppad's origin often fails when target
486 // is very close to real destination, start it directly from target's
487 // origin instead
488 vector ofs = '0 0 0';
489 if (vdist(vec2(tracetest_ent.velocity), <, autocvar_sv_maxspeed))
490 ofs = stepheightvec;
491
492 tracetest_ent.velocity.z = 0;
493 setorigin(tracetest_ent, targ.origin + ofs);
494 tracetoss(tracetest_ent, tracetest_ent);
495 if (trace_startsolid && ofs.z)
496 {
497 setorigin(tracetest_ent, targ.origin + ofs * 0.5);
498 tracetoss(tracetest_ent, tracetest_ent);
499 if (trace_startsolid && ofs.z)
500 {
501 setorigin(tracetest_ent, targ.origin);
502 tracetoss(tracetest_ent, tracetest_ent);
504 return false;
505 }
506 }
507 }
508 tracebox(trace_endpos, tracetest_ent.mins, tracetest_ent.maxs, trace_endpos - eZ * 1500, true, tracetest_ent);
509 return true;
510}
float trace_startsolid
vector stepheightvec
Definition navigation.qh:11

References autocvar_sv_maxspeed, entity(), eZ, org, stepheightvec, trace_endpos, trace_startsolid, vdist, vec2, and vector.

Referenced by trigger_push_test().

◆ trigger_push_testorigin_for_item()

bool trigger_push_testorigin_for_item ( entity tracetest_ent,
entity item,
vector org )

Definition at line 512 of file jumppads.qc.

513{
514 setorigin(tracetest_ent, org);
515 tracetoss(tracetest_ent, tracetest_ent);
516
518 return false;
519 if (trace_ent == item)
520 return true;
521
522 tracebox(trace_endpos, tracetest_ent.mins, tracetest_ent.maxs, trace_endpos - eZ * 1500, true, tracetest_ent);
523
524 if (trace_ent == item)
525 return true;
526
527 return false;
528}

References entity(), eZ, org, trace_endpos, trace_ent, trace_startsolid, and vector.

Referenced by trigger_push_test().

◆ trigger_push_touch()

void trigger_push_touch ( entity this,
entity toucher )

Definition at line 437 of file jumppads.qc.

438{
439 if (this.active == ACTIVE_NOT)
440 return;
441
442 if(this.team)
443 if(((this.spawnflags & INVERT_TEAMS) == 0) == (DIFF_TEAM(this, toucher)))
444 return;
445
447
448 noref bool success = jumppad_push(this, toucher, false);
449
450#ifdef SVQC
451 if (success && (this.spawnflags & PUSH_ONCE))
452 {
453 settouch(this, func_null);
454 setthink(this, SUB_Remove);
455 this.nextthink = time;
456 }
457#endif
458}
float time
float nextthink
void SUB_Remove(entity this)
Remove entity.
Definition defer.qh:13
const int ACTIVE_NOT
Definition defs.qh:36
const int INVERT_TEAMS
Definition defs.qh:10
bool jumppad_push(entity this, entity targ, bool is_velocity_pad)
Definition jumppads.qc:263
const int PUSH_ONCE
Definition jumppads.qh:4
#define EXACTTRIGGER_TOUCH(e, t)
Definition common.qh:115
var void func_null()
#define setthink(e, f)
entity entity toucher
Definition self.qh:72
#define DIFF_TEAM(a, b)
Definition teams.qh:242

References active, ACTIVE_NOT, DIFF_TEAM, entity(), EXACTTRIGGER_TOUCH, func_null(), INVERT_TEAMS, jumppad_push(), nextthink, PUSH_ONCE, setthink, settouch, spawnflags, SUB_Remove(), team, time, and toucher.

Referenced by spawnfunc().

◆ trigger_push_use()

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

Definition at line 6 of file jumppads.qc.

7{
8 if(teamplay)
9 {
10 this.team = actor.team;
12 }
13}
const int SF_TRIGGER_UPDATE
Definition defs.qh:23
int SendFlags
Definition net.qh:159
bool teamplay
Definition teams.qh:59

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

Referenced by spawnfunc(), and spawnfunc().

Variable Documentation

◆ dest

◆ g_jumppads

◆ height

float height

Definition at line 23 of file jumppads.qh.

◆ istypefrag

bool istypefrag

Definition at line 22 of file jumppads.qh.

Referenced by PlayerDamage(), and PutObserverInServer().

◆ jumppadcount

◆ jumppadsused

entity jumppadsused[NUM_JUMPPADSUSED]

Definition at line 29 of file jumppads.qh.

◆ last_pushed

entity last_pushed

Definition at line 25 of file jumppads.qh.

Referenced by SV_PlayerPhysics().

◆ NUM_JUMPPADSUSED

const int NUM_JUMPPADSUSED = 3

Definition at line 27 of file jumppads.qh.

Referenced by jumppad_push().

◆ PUSH_ONCE

const int PUSH_ONCE = BIT(0)

Definition at line 4 of file jumppads.qh.

Referenced by trigger_push_touch().

◆ PUSH_SILENT

const int PUSH_SILENT = BIT(1)

Definition at line 5 of file jumppads.qh.

◆ PUSH_STATIC

const int PUSH_STATIC = BIT(12)

Definition at line 6 of file jumppads.qh.

Referenced by jumppad_push().

◆ pushltime