//print("routerating ", etos(e), " = ", ftos(f), " - ", ftos(rangebias), "\n");
// Evaluate path using jetpack
- if(g_jetpack)
if(this.items & IT_JETPACK)
if(autocvar_bot_ai_navigation_jetpack)
if(vdist(this.origin - goal_org, >, autocvar_bot_ai_navigation_jetpack_mindistance))
LOG_DEBUG("jetpack ai: required fuel ", ftos(fuel), " this.ammo_fuel ", ftos(this.ammo_fuel));
// enough fuel ?
- if(this.ammo_fuel>fuel)
+ if(this.ammo_fuel>fuel || (this.items & IT_UNLIMITED_WEAPON_AMMO))
{
// Estimate cost
// (as onground costs calculation is mostly based on distances, here we do the same establishing some relationship
if (trace_ent == this || tracewalk(this, this.origin, this.mins, this.maxs,
tracewalk_dest, tracewalk_dest_height, bot_navigation_movemode))
{
- LOG_DEBUG("path optimized for ", this.netname, ", removed a goal from the queue");
+ LOG_DEBUG("path optimized for ", this.netname, ", removed a goal from the queue");
navigation_poproute(this);
}
}
void navigation_unstuck(entity this)
{
+ if (!autocvar_bot_wander_enable)
+ return;
+
bool has_user_waypoints = false;
IL_EACH(g_waypoints, !(it.wpflags & WAYPOINTFLAG_GENERATED),
{
float search_radius = 1000;
- if (!autocvar_bot_wander_enable)
- return;
-
if (!bot_waypoint_queue_owner)
{
LOG_DEBUG(this.netname, " stuck, taking over the waypoints queue");