Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Apr 4, 2024
1 parent f133f5f commit 5301ae5
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions maps/mp/bots/_bot_internal.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,12 @@ onWeaponChange()
{
first = false;
newWeapon = self getcurrentweapon();

// hack fix for botstop overridding weapon
if ( newWeapon != "none" )
{
self switchtoweapon( newWeapon );
}
}
else
{
Expand Down Expand Up @@ -916,21 +922,21 @@ updateBones()
{
self endon( "disconnect" );
self endon( "death" );

for ( ;; )
{
oldbones = self.pers[ "bots" ][ "skill" ][ "bones" ];
bones = strtok( oldbones, "," );

while ( oldbones == self.pers[ "bots" ][ "skill" ][ "bones" ] )
{
self waittill_notify_or_timeout( "new_enemy", self.pers[ "bots" ][ "skill" ][ "bone_update_interval" ] );

if ( !isdefined( self.bot.target ) )
{
continue;
}

self.bot.target.bone = PickRandom( bones );
}
}
Expand Down Expand Up @@ -1047,14 +1053,14 @@ targetObjUpdateNoTrace( obj )
checkTraceForBone( myEye, bone )
{
boneLoc = self gettagorigin( bone );

if ( !isdefined( boneLoc ) )
{
return false;
}

trace = bullettrace( myEye, boneLoc, false, undefined );

return ( sighttracepassed( myEye, boneLoc, false, undefined ) && ( trace[ "fraction" ] >= 1.0 || trace[ "surfacetype" ] == "glass" ) );
}

Expand Down Expand Up @@ -1170,8 +1176,8 @@ target_loop()
}

canTargetPlayer = ( ( player checkTraceForBone( myEye, "j_head" ) ||
player checkTraceForBone( myEye, "j_ankle_le" ) ||
player checkTraceForBone( myEye, "j_ankle_ri" ) )
player checkTraceForBone( myEye, "j_ankle_le" ) ||
player checkTraceForBone( myEye, "j_ankle_ri" ) )

&& ( SmokeTrace( myEye, player.origin, level.smokeradius ) ||
daDist < level.bots_maxknifedistance * 4 )
Expand Down Expand Up @@ -1827,6 +1833,7 @@ aim()
for ( ;; )
{
wait 0.05;
waittillframeend;

if ( level.inprematchperiod || level.gameended || self.bot.isfrozen || self isFlared() )
{
Expand Down

0 comments on commit 5301ae5

Please sign in to comment.