Fix multiple script errors.

Bot objective and action improvements.
This commit is contained in:
JezuzLizard
2023-05-02 04:29:34 -07:00
parent 1c835bd77b
commit b9fe21d15f
5 changed files with 301 additions and 46 deletions

View File

@@ -130,6 +130,15 @@ BotPressSmoke( time )
self maps\bots\_bot_internal::smoke( time );
}
/*
Bot jumps
*/
BotJump()
{
self maps\bots\_bot_internal::jump();
}
/*
Returns the bot's random assigned number.
*/
@@ -273,7 +282,11 @@ ClearScriptGoal()
AtScriptGoal()
{
return distanceSquared( self.bot.script_goal, self.origin ) <= self.bot.script_goal_dist * self.bot.script_goal_dist;
if ( !isDefined( self.bot.script_goal ) )
{
return false;
}
return distanceSquared( self.origin, self.bot.script_goal ) <= ( self.bot.script_goal_dist * self.bot.script_goal_dist );
}
/*
@@ -1125,7 +1138,7 @@ assign_priority_to_powerup( powerup )
weapons = players[ i ] getWeaponsListPrimaries();
for ( j = 0; j < weapons.size; j++ )
{
if ( self getWeaponAmmoStock( weapons[ j ] ) <= int( weaponmaxammo( weapons[ j ] ) * LOW_AMMO_THRESHOLD ) )
if ( players[ i ] getWeaponAmmoStock( weapons[ j ] ) <= int( weaponmaxammo( weapons[ j ] ) * LOW_AMMO_THRESHOLD ) )
{
priority += 1;
break;