.float havocbot_cantfindflag;
.float havocbot_role_timeout;
.entity ctf_worldflagnext;
-.entity basewaypoint;
+.entity bot_basewaypoint;
entity ctf_worldflaglist;
vector havocbot_ctf_middlepoint;
if not(head)
return;
- navigation_routerating(head.basewaypoint, ratingscale, 10000);
+ navigation_routerating(head.bot_basewaypoint, ratingscale, 10000);
}
void havocbot_goalrating_ctf_enemyflag(float ratingscale)
if not(head)
return;
- navigation_routerating(head.basewaypoint, ratingscale, 10000);
+ navigation_routerating(head.bot_basewaypoint, ratingscale, 10000);
}
void havocbot_goalrating_ctf_ourstolenflag(float ratingscale)
mf = havocbot_ctf_find_flag(self);
- if(mf.cnt == FLAG_BASE)
+ if(mf.ctf_status == FLAG_BASE)
return;
if(mf.tag_entity)
while (head)
{
// flag is out in the field
- if(head.cnt != FLAG_BASE)
+ if(head.ctf_status != FLAG_BASE)
if(head.tag_entity==world) // dropped
{
if(radius)
// If enemy flag is back on the base switch to previous role
ef = havocbot_ctf_find_enemy_flag(self);
- if(ef.cnt==FLAG_BASE)
+ if(ef.ctf_status==FLAG_BASE)
{
self.havocbot_role = self.havocbot_previous_role;
self.havocbot_role_timeout = 0;
// If the flag carrier reached the base switch to defense
mf = havocbot_ctf_find_flag(self);
- if(mf.cnt!=FLAG_BASE)
+ if(mf.ctf_status!=FLAG_BASE)
if(vlen(ef.origin - mf.dropped_origin) < 300)
{
havocbot_role_ctf_setrole(self, HAVOCBOT_CTF_ROLE_DEFENSE);
ef = havocbot_ctf_find_enemy_flag(self);
// Own flag stolen
- if(mf.cnt!=FLAG_BASE)
+ if(mf.ctf_status!=FLAG_BASE)
{
if(mf.tag_entity)
pos = mf.tag_entity.origin;
}
// Escort flag carrier
- if(ef.cnt!=FLAG_BASE)
+ if(ef.ctf_status!=FLAG_BASE)
{
if(ef.tag_entity)
pos = ef.tag_entity.origin;
// If flag is back on the base switch to previous role
mf = havocbot_ctf_find_flag(self);
- if(mf.cnt==FLAG_BASE)
+ if(mf.ctf_status==FLAG_BASE)
{
havocbot_ctf_reset_role(self);
return;
}
mf = havocbot_ctf_find_flag(self);
- if(mf.cnt!=FLAG_BASE)
+ if(mf.ctf_status!=FLAG_BASE)
{
havocbot_role_ctf_setrole(self, HAVOCBOT_CTF_ROLE_RETRIEVER);
return;
// If own flag was captured
mf = havocbot_ctf_find_flag(self);
- if(mf.cnt!=FLAG_BASE)
+ if(mf.ctf_status!=FLAG_BASE)
{
havocbot_role_ctf_setrole(self, HAVOCBOT_CTF_ROLE_RETRIEVER);
return;
ef = havocbot_ctf_find_enemy_flag(bot);
// Retrieve stolen flag
- if(mf.cnt!=FLAG_BASE)
+ if(mf.ctf_status!=FLAG_BASE)
{
havocbot_role_ctf_setrole(bot, HAVOCBOT_CTF_ROLE_RETRIEVER);
return;
}
// If enemy flag is taken go to the middle to intercept pursuers
- if(ef.cnt!=FLAG_BASE)
+ if(ef.ctf_status!=FLAG_BASE)
{
havocbot_role_ctf_setrole(bot, HAVOCBOT_CTF_ROLE_MIDDLE);
return;