From: Rudolf Polzer Date: Mon, 29 Aug 2011 04:42:13 +0000 (+0200) Subject: bot upstepping: use both stepheightvec and jumpstepheightvec X-Git-Tag: xonotic-v0.5.0~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bacf60ec64767e80584a4fa359c12bbb48712bce;p=xonotic%2Fxonotic-data.pk3dir.git bot upstepping: use both stepheightvec and jumpstepheightvec should fix warpzone issues on space-elevator --- diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index ed5c4b644..7450d8758 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -134,35 +134,41 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float if (trace_fraction < 1) { // check if we can walk over this obstacle, possibly by jumpstepping - tracebox(org + jumpstepheightvec, m1, m2, move + jumpstepheightvec, movemode, e); + tracebox(org + stepheightvec, m1, m2, move + jumpstepheightvec, movemode, e); if (trace_fraction < 1 || trace_startsolid) { - if(autocvar_bot_debug_tracewalk) - debugnodestatus(trace_endpos, DEBUG_NODE_WARNING); - - // check for doors - traceline( org, move, movemode, e); - if ( trace_ent.classname == "door_rotating" || trace_ent.classname == "door") + tracebox(org + jumpstepheightvec, m1, m2, move + jumpstepheightvec, movemode, e); + if (trace_fraction < 1 || trace_startsolid) { - local vector nextmove; - move = trace_endpos; - while(trace_ent.classname == "door_rotating" || trace_ent.classname == "door") + if(autocvar_bot_debug_tracewalk) + debugnodestatus(trace_endpos, DEBUG_NODE_WARNING); + + // check for doors + traceline( org, move, movemode, e); + if ( trace_ent.classname == "door_rotating" || trace_ent.classname == "door") { - nextmove = move + (dir * stepdist); - traceline( move, nextmove, movemode, e); - move = nextmove; + local vector nextmove; + move = trace_endpos; + while(trace_ent.classname == "door_rotating" || trace_ent.classname == "door") + { + nextmove = move + (dir * stepdist); + traceline( move, nextmove, movemode, e); + move = nextmove; + } } - } - else - { - if(autocvar_bot_debug_tracewalk) - debugnodestatus(trace_endpos, DEBUG_NODE_FAIL); + else + { + if(autocvar_bot_debug_tracewalk) + debugnodestatus(trace_endpos, DEBUG_NODE_FAIL); - //print("tracewalk: ", vtos(start), " hit something when trying to reach ", vtos(end), "\n"); - //te_explosion(trace_endpos); - //print(ftos(e.dphitcontentsmask), "\n"); - return FALSE; // failed + //print("tracewalk: ", vtos(start), " hit something when trying to reach ", vtos(end), "\n"); + //te_explosion(trace_endpos); + //print(ftos(e.dphitcontentsmask), "\n"); + return FALSE; // failed + } } + else + move = trace_endpos; } else move = trace_endpos;