#include "navigation.qh"
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
#include "cvars.qh"
#include "bot.qh"
if (trace_fraction < 1)
{
swimming = true;
- org = trace_endpos - normalize(org - trace_endpos) * stepdist;
+ org = trace_endpos + normalize(org - trace_endpos) * stepdist;
for (; org.z < end.z + e.maxs.z; org.z += stepdist)
{
if(autocvar_bot_debug_tracewalk)
if(autocvar_bot_debug_tracewalk)
debugnodestatus(trace_endpos, DEBUG_NODE_WARNING);
- FOREACH_ENTITY_CLASS("func_ladder", true,
+ IL_EACH(g_ladders, it.classname == "func_ladder",
{ it.solid = SOLID_BSP; });
traceline( org, move, movemode, e);
- FOREACH_ENTITY_CLASS("func_ladder", true,
+ IL_EACH(g_ladders, it.classname == "func_ladder",
{ it.solid = SOLID_TRIGGER; });
if ( trace_ent.classname == "door_rotating" || trace_ent.classname == "door")
}
else
{
+ if(autocvar_g_waypointeditor && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout)
+ e.nearestwaypoint = NULL;
+
if ((!e.nearestwaypoint || e.navigation_dynamicgoal)
&& e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout)
{
if(e.navigation_dynamicgoal)
e.nearestwaypointtimeout = time + 2;
+ else if(autocvar_g_waypointeditor)
+ e.nearestwaypointtimeout = time + 3 + random() * 2;
}
nwp = e.nearestwaypoint;
}