]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/jumppads.qh
Merge branch 'master' into terencehill/min_spec_time
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / jumppads.qh
index 5744c66d43e3a0623d3bd78c9d315303f3db3032..cd6adec310ccf2c00b974f92329f519f0561b45e 100644 (file)
@@ -1,8 +1,11 @@
-#ifndef T_JUMPPADS_H
-#define T_JUMPPADS_H
+#pragma once
 
-const float PUSH_ONCE          = 1;
-const float PUSH_SILENT                = 2;
+
+const int PUSH_ONCE = BIT(0); // legacy, deactivate with relay instead
+const int PUSH_SILENT = BIT(1); // not used?
+
+IntrusiveList g_jumppads;
+STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
 
 .float pushltime;
 .float istypefrag;
@@ -12,11 +15,11 @@ const int NUM_JUMPPADSUSED = 3;
 .float jumppadcount;
 .entity jumppadsused[NUM_JUMPPADSUSED];
 
-float trigger_push_calculatevelocity_flighttime;
-
 #ifdef SVQC
 void SUB_UseTargets(entity this, entity actor, entity trigger);
 void trigger_push_use(entity this, entity actor, entity trigger);
+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);
 #endif
 
 /*
@@ -27,18 +30,17 @@ void trigger_push_use(entity this, entity actor, entity trigger);
          tgt - target entity (can be either a point or a model entity; if it is
                the latter, its midpoint is used)
          ht  - jump height, measured from the higher one of org and tgt's midpoint
+         pushed_entity - object that is to be pushed
 
        Returns: velocity for the jump
-       the global trigger_push_calculatevelocity_flighttime is set to the total
-       jump time
  */
+vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity pushed_entity);
 
-vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
-
-void trigger_push_touch();
+void trigger_push_touch(entity this, entity toucher);
 
 .vector dest;
-void trigger_push_findtarget();
+bool trigger_push_test(entity this, entity item);
+void trigger_push_findtarget(entity this);
 
 /*
  * ENTITY PARAMETERS:
@@ -59,4 +61,3 @@ spawnfunc(target_push);
 spawnfunc(info_notnull);
 spawnfunc(target_position);
 #endif
-#endif