// Analyze starting point
traceline(start, start, MOVE_NORMAL, e);
if (trace_dpstartcontents & (DPCONTENTS_SLIME | DPCONTENTS_LAVA))
// Analyze starting point
traceline(start, start, MOVE_NORMAL, e);
if (trace_dpstartcontents & (DPCONTENTS_SLIME | DPCONTENTS_LAVA))
else
{
traceline( start, start + '0 0 -65536', MOVE_NORMAL, e);
if (trace_dpstartcontents & (DPCONTENTS_SLIME | DPCONTENTS_LAVA))
{
else
{
traceline( start, start + '0 0 -65536', MOVE_NORMAL, e);
if (trace_dpstartcontents & (DPCONTENTS_SLIME | DPCONTENTS_LAVA))
{
}
}
tracebox(start, m1, m2, start, MOVE_NOMONSTERS, e);
}
}
tracebox(start, m1, m2, start, MOVE_NOMONSTERS, e);
debugnodestatus(start, DEBUG_NODE_FAIL);
//print("tracewalk: ", vtos(start), " is a bad start\n");
debugnodestatus(start, DEBUG_NODE_FAIL);
//print("tracewalk: ", vtos(start), " is a bad start\n");
debugnodestatus(org, DEBUG_NODE_SUCCESS);
//print("tracewalk: ", vtos(start), " can reach ", vtos(end), "\n");
debugnodestatus(org, DEBUG_NODE_SUCCESS);
//print("tracewalk: ", vtos(start), " can reach ", vtos(end), "\n");
debugnodestatus(org, DEBUG_NODE_FAIL);
//print("tracewalk: ", vtos(start), " hits a hazard when trying to reach ", vtos(end), "\n");
debugnodestatus(org, DEBUG_NODE_FAIL);
//print("tracewalk: ", vtos(start), " hits a hazard when trying to reach ", vtos(end), "\n");
{
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, DEBUG_NODE_FAIL);
{
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, 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");
//print("tracewalk: ", vtos(start), " hit something when trying to reach ", vtos(end), "\n");
//te_explosion(trace_endpos);
//print(ftos(e.dphitcontentsmask), "\n");
float c;
c = pointcontents(org + '0 0 1');
if (!(c == CONTENT_WATER || c == CONTENT_LAVA || c == CONTENT_SLIME))
float c;
c = pointcontents(org + '0 0 1');
if (!(c == CONTENT_WATER || c == CONTENT_LAVA || c == CONTENT_SLIME))
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, DEBUG_NODE_FAIL);
if(autocvar_bot_debug_tracewalk)
debugnodestatus(org, DEBUG_NODE_FAIL);
void navigation_clearroute()
{
//print("bot ", etos(self), " clear\n");
void navigation_clearroute()
{
//print("bot ", etos(self), " clear\n");
self.goalcurrent = world;
self.goalstack01 = world;
self.goalstack02 = world;
self.goalcurrent = world;
self.goalstack01 = world;
self.goalstack02 = world;
- traceline(v, org, TRUE, ent);
+ traceline(v, org, true, ent);
if (trace_fraction == 1)
{
if (walkfromwp)
{
if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
if (trace_fraction == 1)
{
if (walkfromwp)
{
if (tracewalk(ent, v, PL_MIN, PL_MAX, org, bot_navigation_movemode))
}
else
{
if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
}
else
{
if (tracewalk(ent, org, PL_MIN, PL_MAX, v, bot_navigation_movemode))
- v_x = bound(wm1_x, org_x, wm2_x);
- v_y = bound(wm1_y, org_y, wm2_y);
- v_z = bound(wm1_z, org_z, wm2_z);
+ v.x = bound(wm1_x, org.x, wm2_x);
+ v.y = bound(wm1_y, org.y, wm2_y);
+ v.z = bound(wm1_z, org.z, wm2_z);
if (autocvar_g_waypointeditor_auto)
{
entity wp2 = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, wp);
if (autocvar_g_waypointeditor_auto)
{
entity wp2 = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, wp);
- v_x = bound(m1_x, v_x, m2_x);
- v_y = bound(m1_y, v_y, m2_y);
- v_z = bound(m1_z, v_z, m2_z);
+ v.x = bound(m1_x, v.x, m2_x);
+ v.y = bound(m1_y, v.y, m2_y);
+ v.z = bound(m1_z, v.z, m2_z);
if (tracewalk(self, self.origin, self.mins, self.maxs, v, bot_navigation_movemode))
{
head.wpnearestpoint = v;
if (tracewalk(self, self.origin, self.mins, self.maxs, v, bot_navigation_movemode))
{
head.wpnearestpoint = v;
- v_x = bound(m1_x, p_x, m2_x);
- v_y = bound(m1_y, p_y, m2_y);
- v_z = bound(m1_z, p_z, m2_z);
+ v.x = bound(m1_x, p.x, m2_x);
+ v.y = bound(m1_y, p.y, m2_y);
+ v.z = bound(m1_z, p.z, m2_z);
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg;
fixed_source_waypoint.wpfire = 1;
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg;
fixed_source_waypoint.wpfire = 1;
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; // the cost to get from X to fixed_source_waypoint
fixed_source_waypoint.wpfire = 1;
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; // the cost to get from X to fixed_source_waypoint
fixed_source_waypoint.wpfire = 1;
break;
traceline(npa, npb, MOVE_NORMAL, self);
break;
traceline(npa, npb, MOVE_NORMAL, self);
// Rough estimation of fuel consumption
// (ignores acceleration and current xyz velocity)
xydistance = vlen(pointa - pointb);
// Rough estimation of fuel consumption
// (ignores acceleration and current xyz velocity)
xydistance = vlen(pointa - pointb);
bot_debug(strcat("FAILED to find a nearest waypoint to '", e.classname, "' #", etos(e), "\n"));
if(e.flags & FL_ITEM)
bot_debug(strcat("FAILED to find a nearest waypoint to '", e.classname, "' #", etos(e), "\n"));
if(e.flags & FL_ITEM)
// put the entity on the goal stack
//print("routetogoal ", etos(e), "\n");
// put the entity on the goal stack
//print("routetogoal ", etos(e), "\n");
// if it can reach the goal there is nothing more to do
if (tracewalk(self, startposition, PL_MIN, PL_MAX, (e.absmin + e.absmax) * 0.5, bot_navigation_movemode))
// if it can reach the goal there is nothing more to do
if (tracewalk(self, startposition, PL_MIN, PL_MAX, (e.absmin + e.absmax) * 0.5, bot_navigation_movemode))
// see if there are waypoints describing a path to the item
if(e.classname != "waypoint" || (e.wpflags & WAYPOINTFLAG_PERSONAL))
// see if there are waypoints describing a path to the item
if(e.classname != "waypoint" || (e.wpflags & WAYPOINTFLAG_PERSONAL))
- traceline(self.origin + self.view_ofs , self.goalcurrent.origin, TRUE, world);
+ traceline(self.origin + self.view_ofs , self.goalcurrent.origin, true, world);
botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
while (botframe_dangerwaypoint != world)
{
botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
while (botframe_dangerwaypoint != world)
{
- v_x = bound(m1_x, v_x, m2_x);
- v_y = bound(m1_y, v_y, m2_y);
- v_z = bound(m1_z, v_z, m2_z);
+ v.x = bound(m1_x, v.x, m2_x);
+ v.y = bound(m1_y, v.y, m2_y);
+ v.z = bound(m1_z, v.z, m2_z);
- traceline(o, v, TRUE, world);
+ traceline(o, v, true, world);