X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fbot.qc;h=fb76623289bebc239bf8ad9f473a5edae883d65a;hp=a6762c76d0996c7e5db33ec098dcc77eada42e19;hb=a0b626ee78db909c214cc0fc7e829f8a8379704f;hpb=120ad19fdf46b7096a0f90b940e590f1909ad22c diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index a6762c76d..fb7662328 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -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" @@ -29,13 +30,10 @@ #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(); @@ -300,42 +298,42 @@ void bot_custom_weapon_priority_setup() tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," "); int c = 0; - for(i=0; i < tokens && c < WEP_COUNT; ++i){ + for(i=0; i < tokens && c < Weapons_COUNT; ++i){ w = stof(argv(i)); if ( w >= WEP_FIRST && w <= WEP_LAST) { bot_weapons_far[c] = w; ++c; } } - if(c < WEP_COUNT) + if(c < Weapons_COUNT) bot_weapons_far[c] = -1; // Parse mid distance weapon priorities tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_mid)," "); c = 0; - for(i=0; i < tokens && c < WEP_COUNT; ++i){ + for(i=0; i < tokens && c < Weapons_COUNT; ++i){ w = stof(argv(i)); if ( w >= WEP_FIRST && w <= WEP_LAST) { bot_weapons_mid[c] = w; ++c; } } - if(c < WEP_COUNT) + if(c < Weapons_COUNT) bot_weapons_mid[c] = -1; // Parse close distance weapon priorities tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_close)," "); c = 0; - for(i=0; i < tokens && i < WEP_COUNT; ++i){ + for(i=0; i < tokens && i < Weapons_COUNT; ++i){ w = stof(argv(i)); if ( w >= WEP_FIRST && w <= WEP_LAST) { bot_weapons_close[c] = w; ++c; } } - if(c < WEP_COUNT) + if(c < Weapons_COUNT) bot_weapons_close[c] = -1; bot_custom_weapon = true; @@ -574,13 +572,19 @@ float bot_fixcount() activerealplayers = 0; realplayers = 0; - FOR_EACH_REALCLIENT(head) + if(!MUTATOR_CALLHOOK(Bot_FixCount, activerealplayers, realplayers)) { - if(IS_PLAYER(head) || g_lms || head.caplayer == 1) - ++activerealplayers; - ++realplayers; + FOR_EACH_REALCLIENT(head) + { + if(IS_PLAYER(head)) + ++activerealplayers; + ++realplayers; + } } + activerealplayers = bot_activerealplayers; + realplayers = bot_realplayers; + // 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