]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/bot.qc
more improvements - now it somewhat works, but still creates weird and too many waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / bot.qc
index 951d4adb67cc6e5ff8bfb93f372620b7be9b6ec5..c9a54c7f6a79100f2a63323260d00369cd7e0aa2 100644 (file)
@@ -529,6 +529,14 @@ void autoskill(float factor)
                head.totalfrags_lastcheck = head.totalfrags;
 }
 
+void bot_calculate_stepheightvec(void)
+{
+       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       jumpstepheightvec = stepheightvec +
+               ((autocvar_sv_jumpvelocity * autocvar_sv_jumpvelocity) / (2 * autocvar_sv_gravity)) * '0 0 0.85';
+               // 0.75 factor is for safety to make the jumps easy
+}
+
 void bot_serverframe()
 {
        float realplayers, bots, activerealplayers;
@@ -540,7 +548,7 @@ void bot_serverframe()
        if (time < 2)
                return;
 
-       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_calculate_stepheightvec();
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        if(time > autoskill_nextthink)
@@ -614,7 +622,7 @@ void bot_serverframe()
                        localcmd("quit\n");
        }
 
-       if (currentbots > 0 || autocvar_g_waypointeditor)
+       if (currentbots > 0 || autocvar_g_waypointeditor || autocvar_g_waypointeditor_auto)
        if (botframe_spawnedwaypoints)
        {
                if(botframe_cachedwaypointlinks)
@@ -666,6 +674,9 @@ void bot_serverframe()
        if (autocvar_g_waypointeditor)
                botframe_showwaypointlinks();
 
+       if (autocvar_g_waypointeditor_auto)
+               botframe_autowaypoints();
+
        if(time > bot_cvar_nextthink)
        {
                if(currentbots>0)