]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into morosophos/server-current4
authorNick S <nick@teichisma.info>
Thu, 29 Jun 2023 21:46:42 +0000 (00:46 +0300)
committerNick S <nick@teichisma.info>
Thu, 29 Jun 2023 21:46:42 +0000 (00:46 +0300)
1  2 
qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/common/mapobjects/trigger/jumppads.qh

index 6bec3a20c77be50b162a57d0b72de02a76c764fb,f7281e5e4ae2619098dffa22cefb386b9236105f..4dc68505740a7a1decf0dc9a21f62e98c7123db5
@@@ -249,24 -249,22 +249,37 @@@ bool jumppad_push(entity this, entity t
  
        vector org = targ.origin;
  
 -      if(Q3COMPAT_COMMON || this.spawnflags & PUSH_STATIC)
 +      if(STAT(Q3COMPAT, targ) || this.spawnflags & PUSH_STATIC)
 +      {
                org = (this.absmin + this.absmax) * 0.5;
 +      }
 +
 +      bool already_pushed = false;
 +      if(is_velocity_pad) // remember velocity jump pads
 +      {
 +              if(this == targ.last_pushed || (targ.last_pushed && !STAT(Q3COMPAT, targ))) // if q3compat is active overwrite last stored jump pad, otherwise ignore
 +              {
 +                      already_pushed = true;
 +              }
 +              else
 +              {
 +                      targ.last_pushed = this; // may be briefly out of sync between client and server if client prediction is toggled
 +              }
 +      }
  
+       bool already_pushed = false;
+       if(is_velocity_pad) // remember velocity jump pads
+       {
+               if(this == targ.last_pushed || (targ.last_pushed && !STAT(Q3COMPAT, targ))) // if q3compat is active overwrite last stored jump pad, otherwise ignore
+               {
+                       already_pushed = true;
+               }
+               else
+               {
+                       targ.last_pushed = this; // may be briefly out of sync between client and server if client prediction is toggled
+               }
+       }
        if(this.enemy)
        {
                if(!is_velocity_pad)
index 0ef42018a965efc6a23589ac0b5c15a065be4171,7146cc52cb057a3d4d12f19c5664017d0aa71a8f..96ab74aaa684e21c3db602c25f887bf2976aec0b
@@@ -3,16 -3,16 +3,24 @@@
  
  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); // xonotic-only, Q3 already behaves like this by default
 +#define PUSH_STATIC BIT(12) // xonotic-only, Q3 already behaves like this by default
 +
 +#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)
  
+ #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(); }