void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float sradius)
{
entity head;
- float t, i, c, needarmor, needweapons;
+ float t, i, c, needarmor = FALSE, needweapons = FALSE;
// Needs armor/health?
if(self.health<100)
needarmor = TRUE;
// Needs weapons?
+ c = 0;
for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
// Find weapon
- if(power2of(i-1) & self.weapons)
+ if(WEPSET_CONTAINS_EW(self, i))
if(++c>=4)
break;
}
{
// gather health and armor only
if (head.solid)
- if ( ((head.health || head.armorvalue) && needarmor) || (head.weapons && needweapons ) )
+ if ( ((head.health || head.armorvalue) && needarmor) || (!WEPSET_EMPTY_E(head) && needweapons ) )
if (vlen(head.origin - org) < sradius)
{
t = head.bot_pickupevalfunc(self, head);
float havocbot_ons_teamcount(entity bot, float role)
{
- float c;
+ float c = 0;
entity head;
FOR_EACH_PLAYER(head)
continue;
// Ignore owned controlpoints
- if(self.team == COLOR_TEAM1)
+ if(self.team == FL_TEAM_1)
{
if( (cp2.isgenneighbor_blue || cp2.iscpneighbor_blue) && !(cp2.isgenneighbor_red || cp2.iscpneighbor_red) )
continue;
}
- else if(self.team == COLOR_TEAM2)
+ else if(self.team == FL_TEAM_2)
{
if( (cp2.isgenneighbor_red || cp2.iscpneighbor_red) && !(cp2.isgenneighbor_blue || cp2.iscpneighbor_blue) )
continue;
// We'll consider only the best case
bestvalue = 99999999999;
+ cp = world;
for (; cp1; cp1 = cp1.chain)
{
if not(cp1.wpconsidered)
{
// Should be touched
// dprint(self.netname, " found a touchable controlpoint at ", vtos(cp.origin) ,"\n");
+ found = FALSE;
// Look for auto generated waypoint
if not(bot_waypoints_for_items)