]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/bot.qc
When bots are able to bunnyhop reduce travel cost of waypoint links
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / bot.qc
index 1905b7c2728e4a389669b373873c1cb9a482438f..3b9dd7c60ccd8a5b878bb9a01a5e3e2b4a91442c 100644 (file)
@@ -678,6 +678,19 @@ void bot_serverframe()
        if (time < 2)
                return;
 
+       if(autocvar_skill != skill)
+       {
+               float wpcost_update = false;
+               if(skill >= autocvar_bot_ai_bunnyhop_skilloffset && autocvar_skill < autocvar_bot_ai_bunnyhop_skilloffset)
+                       wpcost_update = true;
+               if(skill < autocvar_bot_ai_bunnyhop_skilloffset && autocvar_skill >= autocvar_bot_ai_bunnyhop_skilloffset)
+                       wpcost_update = true;
+
+               skill = autocvar_skill;
+               if (wpcost_update)
+                       waypoint_updatecost_foralllinks();
+       }
+
        bot_calculate_stepheightvec();
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);