]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some minor tweaks to jetpack navigation
authorMario <mario@smbclan.net>
Sun, 3 Jun 2018 11:40:58 +0000 (21:40 +1000)
committerMario <mario@smbclan.net>
Sun, 3 Jun 2018 11:40:58 +0000 (21:40 +1000)
qcsrc/server/bot/default/navigation.qc

index c79ed40a4304cac996f80b84b2917d94ec44ee0e..36f25d79f3a51eabf15fa28ca6495ab06822b0e3 100644 (file)
@@ -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