entity e;
// we are currently holding a weapon that's not fully loaded, reload it
- if(skill >= 2) // bots can only reload held weapons on purpose past this skill
- if(self.clip_load < self.clip_size && self.weapon)
+ if(skill >= 2) // bots can only reload the held weapon on purpose past this skill
+ if(self.clip_load < self.clip_size)
self.impulse = 20; // "press" the reload button, not sure if this is done right
// if we're not reloading a weapon, switch to any weapon in our invnetory that's not fully loaded to reload it next
// the code above executes next frame, starting the reloading then
if(skill >= 5) // bots can only look for unloaded weapons past this skill
if(self.clip_load >= 0) // only if we're not reloading a weapon already
- if not(self.clip_load < self.clip_size && self.weapon) // we're already holding a weapon we can reload, don't look for another
{
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
e = get_weaponinfo(i);
- if(self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+ if ((e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < cvar(strcat("g_balance_", e.netname, "_reload_ammo"))))
self.switchweapon = i;
}
}
// Don't jump when using some weapons
/*
if(self.aistatus & AI_STATUS_ATTACKING)
- if(self.weapon == WEP_SNIPERRIFLE)
+ if(self.weapon == WEP_RIFLE)
return;
if(self.goalcurrent.classname == "player")
if(self.goalcurrent==self.navigation_jetpack_goal)
if(self.ammo_fuel)
{
- #ifdef DEBUG_BOT_GOALSTACK
+ if(autocvar_bot_debug_goalstack)
+ {
debuggoalstack();
te_wizspike(self.navigation_jetpack_point);
- #endif
+ }
// Take off
if not(self.aistatus & AI_STATUS_JETPACK_FLYING)
return;
}
-#ifdef DEBUG_BOT_GOALSTACK
- debuggoalstack();
-#endif
+ if(autocvar_bot_debug_goalstack)
+ debuggoalstack();
m1 = self.goalcurrent.origin + self.goalcurrent.mins;
m2 = self.goalcurrent.origin + self.goalcurrent.maxs;
// I want to do a second scan if no enemy was found or I don't have weapons
// TODO: Perform the scan when using the rifle (requires changes on the rifle code)
- if(best || self.weapons) // || self.weapon == WEP_SNIPERRIFLE
+ if(best || self.weapons) // || self.weapon == WEP_RIFLE
break;
if(i)
break;
}
}
- #ifdef DEBUG_BOT_GOALSTACK
+ if(autocvar_bot_debug_goalstack)
debuggoalstack();
- #endif
// Heading
local vector dir = self.goalcurrent.origin - (self.origin + self.view_ofs);