From: terencehill Date: Wed, 26 Jul 2017 09:15:34 +0000 (+0200) Subject: Fix debug position after navigation_checkladders X-Git-Tag: xonotic-v0.8.5~2378^2~119 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=504ff69b23f9ae4baff5f9da2dbe530dd57d07a6;p=xonotic%2Fxonotic-data.pk3dir.git Fix debug position after navigation_checkladders --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index cf7181dc5..d787cbb87 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -43,7 +43,7 @@ bool navigation_checkladders(entity e, vector org, vector m1, vector m2, vector { if(it.bot_pickup) if(boxesoverlap(org + m1 + '-1 -1 -1', org + m2 + '1 1 1', it.absmin, it.absmax)) - if(boxesoverlap(end, end2, it.absmin + (m1 - eZ * m1.z - '1 1 0'), it.absmax + (m2 - eZ * m2.z + '1 1 0'))) + if(boxesoverlap(end, end2, it.absmin + vec2(m1) + '-1 -1 0', it.absmax + vec2(m2) + '1 1 0')) { vector top = org; top.z = it.absmax.z + (PL_MAX_CONST.z - PL_MIN_CONST.z); @@ -226,12 +226,13 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float e if (trace_fraction < 1 || trace_startsolid) // can't jump obstacle out of water { - if(navigation_checkladders(e, trace_endpos, m1, m2, end, end2, movemode)) + org = trace_endpos; + if(navigation_checkladders(e, org, m1, m2, end, end2, movemode)) { if(autocvar_bot_debug_tracewalk) { - debugnode(e, trace_endpos); - debugnodestatus(trace_endpos, DEBUG_NODE_SUCCESS); + debugnode(e, org); + debugnodestatus(org, DEBUG_NODE_SUCCESS); } //print("tracewalk: ", vtos(start), " can reach ", vtos(end), "\n"); @@ -239,7 +240,7 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float e } if(autocvar_bot_debug_tracewalk) - debugnodestatus(trace_endpos, DEBUG_NODE_FAIL); + debugnodestatus(org, DEBUG_NODE_FAIL); return false; //print("tracewalk: ", vtos(start), " hit something when trying to reach ", vtos(end), "\n");