small changes

This commit is contained in:
ineed bots 2024-04-30 11:03:31 -06:00
parent 28c490b4e6
commit 4fc08e0513
4 changed files with 26 additions and 14 deletions

View File

@ -1088,11 +1088,11 @@ addBots_loop()
if ( fillMode == 0 || fillMode == 2 ) if ( fillMode == 0 || fillMode == 2 )
{ {
amount += players; amount += players;
}
if ( getcvarint( "bots_manage_fill_spec" ) ) if ( getcvarint( "bots_manage_fill_spec" ) )
{ {
amount += spec; amount += spec;
}
} }
if ( amount < fillAmount ) if ( amount < fillAmount )

View File

@ -422,12 +422,6 @@ onWeaponChange()
{ {
first = false; first = false;
newWeapon = self getcurrentweapon(); newWeapon = self getcurrentweapon();
// hack fix for botstop overridding weapon
if ( newWeapon != "none" )
{
self switchtoweapon( newWeapon );
}
} }
else else
{ {
@ -1277,7 +1271,7 @@ aim_loop()
conedot = getConeDot( aimpos, eyePos, angles ); conedot = getConeDot( aimpos, eyePos, angles );
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 ) if ( !nadeAimOffset && conedot > 0.999995 && lengthsquared( aimoffset ) < 0.05 )
{ {
self thread bot_lookat( aimpos, 0.05 ); self thread bot_lookat( aimpos, 0.05 );
} }
@ -1295,7 +1289,7 @@ aim_loop()
conedot = getConeDot( aimpos, eyePos, angles ); conedot = getConeDot( aimpos, eyePos, angles );
if ( !nadeAimOffset && conedot > 0.999 && lengthsquared( aimoffset ) < 0.05 ) if ( !nadeAimOffset && conedot > 0.999995 && lengthsquared( aimoffset ) < 0.05 )
{ {
self thread bot_lookat( aimpos, 0.05 ); self thread bot_lookat( aimpos, 0.05 );
} }
@ -2422,7 +2416,7 @@ bot_lookat( pos, time, vel, doAimPredict )
for ( i = 0; i < steps; i++ ) for ( i = 0; i < steps; i++ )
{ {
myAngle = ( AngleClamp180( myAngle[ 0 ] + X ), AngleClamp180( myAngle[ 1 ] + Y ), 0 ); myAngle = ( AngleClamp180( myAngle[ 0 ] + X ), AngleClamp180( myAngle[ 1 ] + Y ), 0 );
self setplayerangles( myAngle ); self BotBuiltinBotAngles( myAngle );
wait 0.05; wait 0.05;
} }
} }

View File

@ -85,6 +85,17 @@ BotBuiltinIsBot()
return false; return false;
} }
/*
Sets angles
*/
BotBuiltinBotAngles( angles )
{
if ( isdefined( level.bot_builtins ) && isdefined( level.bot_builtins[ "botangles" ] ) )
{
self [[ level.bot_builtins[ "botangles" ] ]]( angles );
}
}
/* /*
Returns if player is the host Returns if player is the host
*/ */

View File

@ -5,6 +5,7 @@ init()
level.bot_builtins[ "botstop" ] = ::do_botstop; level.bot_builtins[ "botstop" ] = ::do_botstop;
level.bot_builtins[ "botmovement" ] = ::do_botmovement; level.bot_builtins[ "botmovement" ] = ::do_botmovement;
level.bot_builtins[ "isbot" ] = ::do_isbot; level.bot_builtins[ "isbot" ] = ::do_isbot;
level.bot_builtins[ "botangles" ] = ::do_botangles;
} }
do_printconsole( s ) do_printconsole( s )
@ -135,3 +136,9 @@ do_isbot()
return false; // no equal in libcod return false; // no equal in libcod
// self isbot(); // self isbot();
} }
do_botangles( angles )
{
self setplayerangles( angles );
// self botangles( angles[ 0 ], angles[ 1 ], angles[ 2 ] );
}