if(autocvar_bot_debug_tracewalk)
debugnodestatus(trace_endpos, DEBUG_NODE_WARNING);
- // check for doors
+ FOREACH_ENTITY_CLASS("func_ladder", true,
+ { it.solid = SOLID_BSP; });
+
traceline( org, move, movemode, e);
+
+ FOREACH_ENTITY_CLASS("func_ladder", true,
+ { it.solid = SOLID_TRIGGER; });
+
if ( trace_ent.classname == "door_rotating" || trace_ent.classname == "door")
{
vector nextmove;
move = nextmove;
}
}
+ else if (trace_ent.classname == "func_ladder")
+ {
+ vector ladder_bottom = trace_endpos - dir * m2.x;
+ vector ladder_top = ladder_bottom;
+ ladder_top.z = trace_ent.absmax.z + (-m1.z + 1);
+ tracebox(ladder_bottom, m1, m2, ladder_top, movemode, e);
+ if (trace_fraction < 1 || trace_startsolid)
+ {
+ if(autocvar_bot_debug_tracewalk)
+ debugnodestatus(trace_endpos, DEBUG_NODE_FAIL);
+
+ return false; // failed
+ }
+ org = ladder_top + dir * m2.x;
+ move = org + dir * stepdist;
+ continue;
+ }
else
{
if(autocvar_bot_debug_tracewalk)