mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-23 02:35:43 +00:00
Added bot_aim dvar
This commit is contained in:
parent
ca9dad8b79
commit
79592e6056
@ -29,6 +29,9 @@ init()
|
||||
if ( getDvar( "bots_main_waitForHostTime" ) == "" )
|
||||
setDvar( "bots_main_waitForHostTime", 10.0 ); //how long to wait to wait for the host player
|
||||
|
||||
if ( getDvar( "bots_main_kickBotsAtEnd" ) == "" )
|
||||
setDvar( "bots_main_kickBotsAtEnd", false ); //kicks the bots at game end
|
||||
|
||||
if ( getDvar( "bots_manage_add" ) == "" )
|
||||
setDvar( "bots_manage_add", 0 ); //amount of bots to add to the game
|
||||
|
||||
@ -113,6 +116,9 @@ init()
|
||||
if ( getDvar( "bots_play_ads" ) == "" ) //bot ads
|
||||
setDvar( "bots_play_ads", true );
|
||||
|
||||
if ( getDvar( "bots_play_aim" ) == "" )
|
||||
setDvar( "bots_play_aim", true );
|
||||
|
||||
if ( !isDefined( game["botWarfare"] ) )
|
||||
game["botWarfare"] = true;
|
||||
|
||||
@ -182,6 +188,11 @@ handleBots()
|
||||
wait 0.05;
|
||||
|
||||
setDvar( "bots_manage_add", getBotArray().size );
|
||||
|
||||
if ( !getDvarInt( "bots_main_kickBotsAtEnd" ) )
|
||||
return;
|
||||
|
||||
removeAllTestClients();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1302,7 +1302,9 @@ aim_loop()
|
||||
}
|
||||
}
|
||||
|
||||
self botLookAt( last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset ), aimspeed );
|
||||
if ( getDvarInt( "bots_play_aim" ) )
|
||||
self botLookAt( last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset ), aimspeed );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1324,10 +1326,13 @@ aim_loop()
|
||||
|
||||
conedot = getConeDot( aimpos, eyePos, angles );
|
||||
|
||||
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 )
|
||||
self botLookAtPlayer( target, bone );
|
||||
else
|
||||
self botLookAt( aimpos, aimspeed );
|
||||
if ( getDvarInt( "bots_play_aim" ) )
|
||||
{
|
||||
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 )
|
||||
self botLookAtPlayer( target, bone );
|
||||
else
|
||||
self botLookAt( aimpos, aimspeed );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1338,7 +1343,8 @@ aim_loop()
|
||||
|
||||
conedot = getConeDot( aimpos, eyePos, angles );
|
||||
|
||||
self botLookAt( aimpos, aimspeed );
|
||||
if ( getDvarInt( "bots_play_aim" ) )
|
||||
self botLookAt( aimpos, aimspeed );
|
||||
}
|
||||
|
||||
if ( isplay && !self.bot.isknifingafter && conedot > 0.9 && dist < level.bots_maxKnifeDistance && trace_time > reaction_time && getDvarInt( "bots_play_knife" ) )
|
||||
@ -1397,7 +1403,8 @@ aim_loop()
|
||||
aimpos = last_pos + ( 0, 0, self getEyeHeight() + nadeAimOffset );
|
||||
conedot = getConeDot( aimpos, eyePos, angles );
|
||||
|
||||
self botLookAt( aimpos, aimspeed );
|
||||
if ( getDvarInt( "bots_play_aim" ) )
|
||||
self botLookAt( aimpos, aimspeed );
|
||||
|
||||
if ( !self canFire( curweap ) || !self isInRange( dist, curweap ) )
|
||||
return;
|
||||
@ -1430,11 +1437,13 @@ aim_loop()
|
||||
{
|
||||
forwardPos = anglesToForward( level.waypoints[self.bot.next_wp].angles ) * 1024;
|
||||
|
||||
self botLookAt( eyePos + forwardPos, aimspeed );
|
||||
if ( getDvarInt( "bots_play_aim" ) )
|
||||
self botLookAt( eyePos + forwardPos, aimspeed );
|
||||
}
|
||||
else if ( isDefined( self.bot.script_aimpos ) )
|
||||
{
|
||||
self botLookAt( self.bot.script_aimpos, aimspeed );
|
||||
if ( getDvarInt( "bots_play_aim" ) )
|
||||
self botLookAt( self.bot.script_aimpos, aimspeed );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1445,7 +1454,7 @@ aim_loop()
|
||||
else if ( isDefined( self.bot.towards_goal ) )
|
||||
lookat = self.bot.towards_goal;
|
||||
|
||||
if ( isDefined( lookat ) )
|
||||
if ( isDefined( lookat ) && getDvarInt( "bots_play_aim" ) )
|
||||
self botLookAt( lookat + ( 0, 0, self getEyeHeight() ), aimspeed );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user