// Returns first bot with matching name
entity find_bot_by_name(string name)
{
- local entity bot;
+ entity bot;
bot = findchainflags(flags, FL_CLIENT);
while (bot)
// Returns a bot by number on list
entity find_bot_by_number(float number)
{
- local entity bot;
- local float c;
+ entity bot;
+ float c;
if(!number)
return world;
float bot_decodecommand(string cmdstring)
{
- local float cmd_parm_type, i;
+ float cmd_parm_type, i;
float sp;
string parm;
void bot_cmdhelp(string scmd)
{
- local float i, ntype;
- local string stype;
+ float i, ntype;
+ string stype;
if(!bot_cmds_initialized)
bot_commands_init();
void bot_list_commands()
{
- local float i;
- local string ptype;
+ float i;
+ string ptype;
if(!bot_cmds_initialized)
bot_commands_init();
float bot_cmd_select_weapon()
{
- local float id;
+ float id;
id = bot_cmd.bot_cmd_parm_float;
float bot_cmd_if()
{
- local string expr, val_a, val_b;
- local float cmpofs;
+ string expr, val_a, val_b;
+ float cmpofs;
if(self.bot_cmd_condition_status != CMD_CONDITION_NONE)
{
// Current direction
if(self.bot_cmd_aim_endtime)
{
- local float progress;
+ float progress;
progress = min(1 - (self.bot_cmd_aim_endtime - time) / (self.bot_cmd_aim_endtime - self.bot_cmd_aim_begintime),1);
self.v_angle = self.bot_cmd_aim_begin + ((self.bot_cmd_aim_end - self.bot_cmd_aim_begin) * progress);
}
// New aiming direction
- local string parms;
- local float tokens, step;
+ string parms;
+ float tokens, step;
parms = bot_cmd.bot_cmd_parm_string;
return bot_cmd_aim();
}
- local entity e;
- local string parms;
- local vector v;
- local float tokens, step;
+ entity e;
+ string parms;
+ vector v;
+ float tokens, step;
parms = bot_cmd.bot_cmd_parm_string;
float bot_cmd_presskey()
{
- local string key;
+ string key;
key = bot_cmd.bot_cmd_parm_string;
float bot_cmd_releasekey()
{
- local string key;
+ string key;
key = bot_cmd.bot_cmd_parm_string;
return CMD_STATUS_FINISHED;
}
+.entity tuba_note;
float bot_cmd_debug_assert_canfire()
{
float f;
print("Bot wants to fire, inhibited by ATTACK_FINISHED\n");
}
}
+ else if(self.tuba_note)
+ {
+ if(f)
+ {
+ self.colormod = '8 0 0';
+ print("Bot wants to fire, bot still has an active tuba note\n");
+ }
+ }
else
{
if(!f)
// NOTE: Of course you need to include your commands here too :)
float bot_execute_commands_once()
{
- local float status, ispressingkey;
+ float status, ispressingkey;
// Find command
bot_setcurrentcommand();
{
if(autocvar_g_debug_bot_commands)
{
- local string parms;
+ string parms;
switch(bot_cmd_parm_type[bot_cmd.bot_cmd_type])
{