tracebox(org + jumpstepheightvec, m1, m2, move + jumpstepheightvec, movemode, e);
if (trace_fraction < 1 || trace_startsolid)
{
- FOREACH_ENTITY_CLASS("func_ladder", true,
+ bool ladder_found = false;
++ IL_EACH(g_ladders, it.classname == "func_ladder",
+ {
+ if(boxesoverlap(org + jumpheight_vec + m1 + '-1 -1 -1', org + jumpheight_vec + 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')))
+ ladder_found = true; // can't return here ("Loop mutex held by tracewalk" error)
+ });
+ if(ladder_found)
+ {
+ if(autocvar_bot_debug_tracewalk)
+ debugnodestatus(end, DEBUG_NODE_SUCCESS);
+
+ //print("tracewalk: ", vtos(start), " can reach ", vtos(end), "\n");
+ return true;
+ }
+
if(autocvar_bot_debug_tracewalk)
debugnodestatus(trace_endpos, DEBUG_NODE_WARNING);