]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/Juhu/q3_jumppads' into morosophos/server-current4
authorNick S <nick@teichisma.info>
Sun, 5 Feb 2023 20:02:30 +0000 (22:02 +0200)
committerNick S <nick@teichisma.info>
Sun, 5 Feb 2023 20:02:30 +0000 (22:02 +0200)
1  2 
qcsrc/common/mapobjects/trigger/jumppads.qc
xonotic-server.cfg

index fca91832d2c68f6f71ca994b74a8c2d3dd7ed11d,8d6704ae0fb7ab5563c1a726efbec7b5379287de..2ea71ac33189d60951800c971d593180e2b24c6b
@@@ -269,53 -135,14 +269,52 @@@ bool jumppad_push(entity this, entity t
  
        vector org = targ.origin;
  
-       if(STAT(Q3COMPAT))
+       if(STAT(Q3COMPAT) && (STAT(Q3COMPAT_JUMPPADS) >= 1) || (STAT(Q3COMPAT_JUMPPADS) >= 2))
        {
-               org.z += targ.mins_z;
-               org.z += 1; // off by 1!
+               org = (this.absmin + this.absmax) * 0.5;
        }
  
 +      bool is_pushed = false;
 +      if(is_velocity_pad)
 +      {
 +              for(int i = 0; i < MAX_PUSHED; ++i)
 +              {
 +                      if(this == targ.has_pushed[i])
 +                      {
 +                              is_pushed = true;
 +                              break;
 +                      }
 +              }
 +
 +              if(!is_pushed) // remember velocity jump pads
 +              {
 +                      bool limit_reached = true;
 +                      for(int i = 0; i < MAX_PUSHED; ++i)
 +                      {
 +                              if(targ.has_pushed[i]) continue;
 +                              limit_reached = false;
 +                              targ.has_pushed[i] = this; // may be briefly out of sync between client and server if client prediction is toggled
 +                              break;
 +                      }
 +                      if(limit_reached)
 +                      {
 +                              return false; // too many overlapping jump pads
 +                      }
 +                      IL_PUSH(are_pushed, targ);
 +                      this.nextthink = time;
 +              }
 +      }
 +
        if(this.enemy)
        {
 -              targ.velocity = trigger_push_calculatevelocity(org, this.enemy, this.height, targ);
 +              if(!is_velocity_pad)
 +              {
 +                      targ.velocity = trigger_push_calculatevelocity(org, this.enemy, this.height, targ);
 +              }
 +              else
 +              {
 +                      targ.velocity = trigger_push_velocity_calculatevelocity(this, org, this.enemy, this.speed, this.count, targ, is_pushed);
 +              }
        }
        else if(this.target && this.target != "")
        {
Simple merge