]> 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 5ffdf2d1066085d9bd47fd1dd5d541af179b4671..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
        {