Skip to content

Commit

Permalink
update bones
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Apr 4, 2024
1 parent 5719080 commit 60a8f65
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions maps/mp/bots/_bot_internal.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -1174,30 +1174,30 @@ reload_thread()
*/
updateBones()
{
self notify( "bot_updateBones" );
self endon( "bot_updateBones" );

self endon( "disconnect" );
self endon( "spawned_player" );

bones = strtok( self.pers[ "bots" ][ "skill" ][ "bones" ], "," );
waittime = self.pers[ "bots" ][ "skill" ][ "bone_update_interval" ];

for ( ;; )
{
self waittill_any_timeout( waittime, "new_enemy" );

if ( !isalive( self ) )
{
return;
}
oldbones = self.pers[ "bots" ][ "skill" ][ "bones" ];
bones = strtok( oldbones, "," );

if ( !isdefined( self.bot.target ) )
while ( oldbones == self.pers[ "bots" ][ "skill" ][ "bones" ] )
{
continue;
self waittill_any_timeout( self.pers[ "bots" ][ "skill" ][ "bone_update_interval" ], "new_enemy" );

if ( !isalive( self ) )
{
return;
}

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

self.bot.target.bone = random( bones );
}

self.bot.target.bone = random( bones );
}
}

Expand Down

0 comments on commit 60a8f65

Please sign in to comment.