From: terencehill Date: Sun, 31 Dec 2017 17:06:55 +0000 (+0100) Subject: Improve destination waypoint generation of jumppads with a high horizontal push.... X-Git-Tag: xonotic-v0.8.5~2378^2~3^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=996b4fa4f78dcd5d4545a543b0ecc7b53b309c80;p=xonotic%2Fxonotic-data.pk3dir.git Improve destination waypoint generation of jumppads with a high horizontal push. It fixes jumppad to jumppad to strength and jumppad to vortex in the map The Yard --- diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index d10a1e330..dc9cb761a 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -278,23 +278,27 @@ bool trigger_push_testorigin(entity tracetest_ent, entity targ, entity jp, vecto if(trace_startsolid) return false; - if(!jp.height) + if (!jp.height) { // since tracetoss starting from jumppad's origin often fails when target // is very close to real destination, start it directly from target's // origin instead + vector ofs = '0 0 0'; + if (vdist(vec2(tracetest_ent.velocity), <, autocvar_sv_maxspeed)) + ofs = stepheightvec; + tracetest_ent.velocity.z = 0; - setorigin(tracetest_ent, targ.origin + stepheightvec); + setorigin(tracetest_ent, targ.origin + ofs); tracetoss(tracetest_ent, tracetest_ent); - if(trace_startsolid) + if (trace_startsolid && ofs.z) { - setorigin(tracetest_ent, targ.origin + stepheightvec / 2); + setorigin(tracetest_ent, targ.origin + ofs / 2); tracetoss(tracetest_ent, tracetest_ent); - if(trace_startsolid) + if (trace_startsolid && ofs.z) { setorigin(tracetest_ent, targ.origin); tracetoss(tracetest_ent, tracetest_ent); - if(trace_startsolid) + if (trace_startsolid) return false; } } @@ -307,7 +311,7 @@ void trigger_push_findtarget(entity this) { // first calculate a typical start point for the jump vector org = (this.absmin + this.absmax) * 0.5; - org.z = this.absmax.z - PL_MIN_CONST.z; + org.z = this.absmax.z - PL_MIN_CONST.z - 10; if (this.target) {