]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/Juhu/velocity_pads' into morosophos/server-current4
authorNick S <nick@teichisma.info>
Wed, 15 Feb 2023 18:33:51 +0000 (20:33 +0200)
committerNick S <nick@teichisma.info>
Wed, 15 Feb 2023 18:33:51 +0000 (20:33 +0200)
qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/common/mapobjects/trigger/jumppads.qh

index 9c786dd98585ea355d18a9ed36ccc4be7f597ea7..debd750815841f9ac07cb6cd8ce66a50ae2b92c4 100644 (file)
@@ -307,8 +307,11 @@ bool jumppad_push(entity this, entity targ, bool is_velocity_pad)
                        {
                                return false; // too many overlapping jump pads
                        }
-                       IL_PUSH(are_pushed, targ);
-                       this.nextthink = time;
+                       if(!IL_CONTAINS(are_pushed, targ))
+                       {
+                               IL_PUSH(are_pushed, targ);
+                               this.nextthink = time;
+                       }
                }
        }
 
index 70845017c62051bda45c425400e10bc8a675cdfd..3f63fc8f455d4b325ce73daacd10f321436b83e4 100644 (file)
@@ -5,13 +5,13 @@ const int PUSH_ONCE = BIT(0); // legacy, deactivate with relay instead
 const int PUSH_SILENT = BIT(1); // not used?
 const int PUSH_STATIC = BIT(12);
 
-const int PUSH_VELOCITY_PLAYERDIR_XY = BIT(0);
-const int PUSH_VELOCITY_ADD_XY = BIT(1);
-const int PUSH_VELOCITY_PLAYERDIR_Z = BIT(2);
-const int PUSH_VELOCITY_ADD_Z = BIT(3);
-const int PUSH_VELOCITY_BIDIRECTIONAL_XY = BIT(4);
-const int PUSH_VELOCITY_BIDIRECTIONAL_Z = BIT(5);
-const int PUSH_VELOCITY_CLAMP_NEGATIVE_ADDS = BIT(6);
+#define PUSH_VELOCITY_PLAYERDIR_XY        BIT(0)
+#define PUSH_VELOCITY_ADD_XY              BIT(1)
+#define PUSH_VELOCITY_PLAYERDIR_Z         BIT(2)
+#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)
 
 IntrusiveList g_jumppads;
 STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
@@ -20,7 +20,9 @@ STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); }
 .bool istypefrag;
 .float height;
 
-const int MAX_PUSHED = 16; // maximum amount of jump pads which are allowed to push simultaneously
+// maximum amount of jump pads which are allowed to push simultaneously
+#define MAX_PUSHED 16
+
 .entity has_pushed[MAX_PUSHED];
 IntrusiveList are_pushed;
 STATIC_INIT(are_pushed) { are_pushed = IL_NEW(); }