]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/bot.qc
Merge branch 'terencehill/quickmenu_file_example' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / bot.qc
index 00051cadb9cbdeee1b806ac9a7f8ec104a97f4ff..b125564716ae122e5a6cd4dd415e4e6d4a7e1189 100644 (file)
@@ -1,5 +1,4 @@
 #include "bot.qh"
-#include "../_all.qh"
 
 #include "aim.qh"
 #include "navigation.qh"
@@ -9,6 +8,8 @@
 #include "havocbot/havocbot.qh"
 #include "havocbot/scripting.qh"
 
+#include "../teamplay.qh"
+
 #include "../antilag.qh"
 #include "../autocvars.qh"
 #include "../campaign.qh"
@@ -18,7 +19,7 @@
 #include "../race.qh"
 #include "../t_items.qh"
 
-#include "../mutators/mutators_include.qh"
+#include "../mutators/all.qh"
 
 #include "../weapons/accuracy.qh"
 
 
 #include "../../common/weapons/all.qh"
 
-#include "../../csqcmodellib/sv_model.qh"
-
-#include "../../dpdefs/dpextensions.qh"
-#include "../../dpdefs/progsdefs.qh"
+#include "../../lib/csqcmodel/sv_model.qh"
 
-#include "../../warpzonelib/common.qh"
-#include "../../warpzonelib/util_server.qh"
+#include "../../lib/warpzone/common.qh"
+#include "../../lib/warpzone/util_server.qh"
 
 entity bot_spawn()
 {SELFPARAM();
@@ -558,7 +556,7 @@ void autoskill(float factor)
                head.totalfrags_lastcheck = head.totalfrags;
 }
 
-void bot_calculate_stepheightvec(void)
+void bot_calculate_stepheightvec()
 {
        stepheightvec = autocvar_sv_stepheight * '0 0 1';
        jumpstepheightvec = stepheightvec +
@@ -568,19 +566,22 @@ void bot_calculate_stepheightvec(void)
 
 float bot_fixcount()
 {
-       entity head;
-       float realplayers, bots, activerealplayers;
-
-       activerealplayers = 0;
-       realplayers = 0;
-
-       FOR_EACH_REALCLIENT(head)
-       {
-               if(IS_PLAYER(head) || g_lms || head.caplayer == 1)
-                       ++activerealplayers;
-               ++realplayers;
+       int activerealplayers = 0;
+       int realplayers = 0;
+       if (MUTATOR_CALLHOOK(Bot_FixCount, activerealplayers, realplayers)) {
+               activerealplayers = bot_activerealplayers;
+               realplayers = bot_realplayers;
+       } else {
+               entity head;
+               FOR_EACH_REALCLIENT(head)
+               {
+                       if(IS_PLAYER(head))
+                               ++activerealplayers;
+                       ++realplayers;
+               }
        }
 
+       int bots;
        // add/remove bots if needed to make sure there are at least
        // minplayers+bot_number, or remove all bots if no one is playing
        // But don't remove bots immediately on level change, as the real players