+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+ #include "../../dpdefs/progsdefs.qh"
+ #include "../../dpdefs/dpextensions.qh"
+ #include "../../warpzonelib/common.qh"
+ #include "../../warpzonelib/util_server.qh"
+ #include "../../common/constants.qh"
+ #include "../../common/teams.qh"
+ #include "../../common/util.qh"
+ #include "../../common/weapons/weapons.qh"
+ #include "../weapons/accuracy.qh"
+ #include "../t_items.qh"
+ #include "../autocvars.qh"
+ #include "../constants.qh"
+ #include "../defs.qh"
+ #include "../mutators/mutators_include.qh"
+ #include "../campaign.qh"
+ #include "../../common/mapinfo.qh"
+ #include "../../csqcmodellib/sv_model.qh"
+ #include "../antilag.qh"
+#endif
+
#include "bot.qh"
#include "aim.qh"
#include "navigation.qh"
if (self.bot_nextthink > time)
return;
- self.flags &~= FL_GODMODE;
+ self.flags &= ~FL_GODMODE;
if(autocvar_bot_god)
self.flags |= FL_GODMODE;
//self.bot_painintensity = self.bot_painintensity + self.bot_oldhealth - self.health;
//self.bot_painintensity = bound(0, self.bot_painintensity, 100);
- if (autocvar_g_campaign && !campaign_bots_may_start)
+ if (!IS_PLAYER(self) || (autocvar_g_campaign && !campaign_bots_may_start))
{
self.bot_nextthink = time + 0.5;
return;
{
self.v_angle = self.angles;
self.v_angle_z = 0;
- self.fixangle = FALSE;
+ self.fixangle = false;
}
self.dmg_take = 0;
prio = 1;
FOR_EACH_CLIENT(p)
{
- if(clienttype(p) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(p))
if(s == p.cleanname)
{
prio = 0;
READSKILL(bot_thinkskill, 1, 0.5); // think skill
READSKILL(bot_aiskill, 2, 0); // "ai" skill
- self.bot_config_loaded = TRUE;
+ self.bot_config_loaded = true;
// this is really only a default, JoinBestTeam is called later
setcolor(self, stof(bot_shirt) * 16 + stof(bot_pants));
i = 0;
FOR_EACH_CLIENT(p)
{
- if(clienttype(p) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(p))
if(p.cleanname == name)
++i;
}
{
float tokens, i, c, w;
- bot_custom_weapon = FALSE;
+ bot_custom_weapon = false;
if( autocvar_bot_ai_custom_weapon_priority_far == "" ||
autocvar_bot_ai_custom_weapon_priority_mid == "" ||
if(c < WEP_COUNT)
bot_weapons_close[c] = -1;
- bot_custom_weapon = TRUE;
+ bot_custom_weapon = true;
}
void bot_endgame()
{
player_count = player_count + 1;
e.nextplayer = e.chain;
- if (clienttype(e) == CLIENTTYPE_BOT)
+ if (IS_BOT_CLIENT(e))
{
if (prevbot)
prevbot.nextbot = e;
}
dprint(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
bot_strategytoken = bot_list;
- bot_strategytoken_taken = TRUE;
+ bot_strategytoken_taken = true;
}
void bot_clientdisconnect()
{
- if (clienttype(self) != CLIENTTYPE_BOT)
+ if (!IS_BOT_CLIENT(self))
return;
bot_clearqueue(self);
if(self.cleanname)
void bot_clientconnect()
{
- if (clienttype(self) != CLIENTTYPE_BOT)
+ if (!IS_BOT_CLIENT(self))
return;
self.bot_preferredcolors = self.clientcolors;
self.bot_nextthink = time - random();
self.lag_func = bot_lagfunc;
- self.isbot = TRUE;
+ self.isbot = true;
self.createdtime = self.bot_nextthink;
if(!self.bot_config_loaded) // This is needed so team overrider doesn't break between matches
else if(self.bot_forced_team==4)
self.team = NUM_TEAM_4;
else
- JoinBestTeam(self, FALSE, TRUE);
+ JoinBestTeam(self, false, true);
havocbot_setupbot();
}
entity best, head;
CheckAllowedTeams(world);
GetTeamCounts(world);
- head = findchainfloat(isbot, TRUE);
+ head = findchainfloat(isbot, true);
if (!head)
return;
best = head;
return;
}
- head = findchainfloat(isbot, TRUE);
+ head = findchainfloat(isbot, true);
if (!head)
return;
best = head;
bestplayer = -1;
FOR_EACH_PLAYER(head)
{
- if(clienttype(head) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(head))
bestplayer = max(bestplayer, head.totalfrags - head.totalfrags_lastcheck);
else
bestbot = max(bestbot, head.totalfrags - head.totalfrags_lastcheck);
FOR_EACH_REALCLIENT(head)
{
- if(head.classname == "player" || g_lms || g_arena || head.caplayer == 1)
+ if(IS_PLAYER(head) || g_lms || head.caplayer == 1)
++activerealplayers;
++realplayers;
}
// 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
// usually haven't rejoined yet
- bots_would_leave = FALSE;
+ bots_would_leave = false;
if (teamplay && autocvar_bot_vs_human && (c3==-1 && c4==-1))
bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);
if(bots > minbots)
- bots_would_leave = TRUE;
+ bots_would_leave = true;
}
else
{
if (bot_spawn() == world)
{
bprint("Can not add bot, server full.\n");
- return FALSE;
+ return false;
}
}
while (currentbots > bots)
bot_removenewest();
}
- return TRUE;
+ return true;
}
void bot_serverframe()
}
else
{
- botframe_spawnedwaypoints = TRUE;
+ botframe_spawnedwaypoints = true;
waypoint_loadall();
if(!waypoint_load_links())
waypoint_schedulerelinkall();
// frame, which causes choppy framerates)
if (bot_strategytoken_taken)
{
- bot_strategytoken_taken = FALSE;
+ bot_strategytoken_taken = false;
if (bot_strategytoken)
bot_strategytoken = bot_strategytoken.nextbot;
if (!bot_strategytoken)