]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/jumppads.qc
Offset jumppad push target position by the entity's height in VQ3 compatibility mode...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / jumppads.qc
index b32b4d262d90885ece07a79c95727c8298d1c69c..ca1faeaf93c2ddd97e8c3ef052c3d770122cde26 100644 (file)
@@ -133,9 +133,20 @@ bool jumppad_push(entity this, entity targ)
        if (!isPushable(targ))
                return false;
 
+       vector org = targ.origin;
+#ifdef SVQC
+       if(autocvar_sv_vq3compat)
+#elif defined(CSQC)
+       if(STAT(VQ3COMPAT))
+#endif
+       {
+               org.z += targ.mins_z;
+               org.z += 1; // off by 1!
+       }
+
        if(this.enemy)
        {
-               targ.velocity = trigger_push_calculatevelocity(targ.origin, this.enemy, this.height, targ);
+               targ.velocity = trigger_push_calculatevelocity(org, this.enemy, this.height, targ);
        }
        else if(this.target && this.target != "")
        {
@@ -148,7 +159,7 @@ bool jumppad_push(entity this, entity targ)
                        else
                                RandomSelection_AddEnt(e, 1, 1);
                }
-               targ.velocity = trigger_push_calculatevelocity(targ.origin, RandomSelection_chosen_ent, this.height, targ);
+               targ.velocity = trigger_push_calculatevelocity(org, RandomSelection_chosen_ent, this.height, targ);
        }
        else
        {
@@ -334,8 +345,7 @@ bool trigger_push_test(entity this, entity item)
 {
        // first calculate a typical start point for the jump
        vector org = (this.absmin + this.absmax) * 0.5;
-       if(!STAT(VQ3COMPAT))
-               org.z = this.absmax.z - PL_MIN_CONST.z - 7;
+       org.z = this.absmax.z - PL_MIN_CONST.z - 7;
 
        if (this.target)
        {