.float(entity player, entity item) bot_pickupevalfunc;
.string cleanname;
.float havocbot_role_timeout;
+.void(entity this) havocbot_role;
+.void(entity this) havocbot_previous_role;
.float isbot; // true if this client is actually a bot
.float lastteleporttime;
.float navigation_hasgoals;
float havocbot_middlepoint_radius;
vector havocbot_symmetryaxis_equation;
+.float goalentity_lock_timeout;
.float ignoregoaltime;
.entity ignoregoal;
.int havocbot_role_flags;
.float havocbot_attack_time;
-.void(entity this) havocbot_role;
-.void(entity this) havocbot_previous_role;
-
void(entity this) havocbot_role_ast_defense;
void(entity this) havocbot_role_ast_offense;
bot.havocbot_role = havocbot_role_ctf_carrier;
bot.havocbot_role_timeout = 0;
bot.havocbot_cantfindflag = time + 10;
- navigation_goalrating_timeout_force(bot);
+ if (bot.havocbot_previous_role != bot.havocbot_role)
+ navigation_goalrating_timeout_force(bot);
break;
case HAVOCBOT_CTF_ROLE_DEFENSE:
s = "defense";
bot.havocbot_previous_role = bot.havocbot_role;
bot.havocbot_role = havocbot_role_ctf_retriever;
bot.havocbot_role_timeout = time + 10;
- navigation_goalrating_timeout_force(bot);
+ if (bot.havocbot_previous_role != bot.havocbot_role)
+ navigation_goalrating_timeout_expire(bot, 2);
break;
case HAVOCBOT_CTF_ROLE_ESCORT:
s = "escort";
bot.havocbot_previous_role = bot.havocbot_role;
bot.havocbot_role = havocbot_role_ctf_escort;
bot.havocbot_role_timeout = time + 30;
- navigation_goalrating_timeout_force(bot);
+ if (bot.havocbot_previous_role != bot.havocbot_role)
+ navigation_goalrating_timeout_expire(bot, 2);
break;
}
LOG_TRACE(bot.netname, " switched to ", s);
if (!this.ballcarried)
{
this.havocbot_role = havocbot_role_ka_collector;
- navigation_goalrating_timeout_force(this);
+ navigation_goalrating_timeout_expire(this, 2);
}
}
if (this.ballcarried)
{
this.havocbot_role = havocbot_role_ka_carrier;
- navigation_goalrating_timeout_force(this);
+ navigation_goalrating_timeout_expire(this, 2);
}
}
#define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE)
#define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
-#define IS_MOVABLE(v) (((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v)) || IS_VEHICLE(v))
+#define IS_MOVABLE(v) ((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v))
// NOTE: FOR_EACH_CLIENTSLOT deprecated! Use the following instead: FOREACH_CLIENTSLOT(true, { code; });
// NOTE: FOR_EACH_CLIENT deprecated! Use the following instead: FOREACH_CLIENT(true, { code; });