X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fnavigation.qc;h=36f25d79f3a51eabf15fa28ca6495ab06822b0e3;hb=073cc17f87486bec59ac2b6f9c26bf1155dbd7d8;hp=2bf04bac261aa9b40168000f1e846ccf85b2dc11;hpb=0435ec3177b324c9e07ebf64dbb9b56185240372;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 2bf04bac2..36f25d79f 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1256,7 +1256,6 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) //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)) @@ -1318,7 +1317,7 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) 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 @@ -1573,7 +1572,7 @@ void navigation_shortenpath(entity this) 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); } } @@ -1808,6 +1807,9 @@ void botframe_updatedangerousobjects(float maxupdate) void navigation_unstuck(entity this) { + if (!autocvar_bot_wander_enable) + return; + bool has_user_waypoints = false; IL_EACH(g_waypoints, !(it.wpflags & WAYPOINTFLAG_GENERATED), { @@ -1819,9 +1821,6 @@ void navigation_unstuck(entity this) 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");