Skip to content

Commit

Permalink
connection events
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Apr 25, 2024
1 parent f928907 commit dfb4fd6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions maps/mp/bots/_bot.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ killTags()
{
for ( i = 0; i < self.tags.size; i++ )
{
self.tags[ i ] delete();
self.tags[ i ] delete ();
}

self.tags = undefined;
Expand Down Expand Up @@ -518,6 +518,14 @@ onDisconnectPlayer()
self killTags();

level.players = array_remove( level.players, self );

waittillframeend;

for ( i = 0; i < level.bots.size; i++ )
{
bot = level.bots[ i ];
bot BotNotifyBotEvent( "connection", "disconnected", self, self.name );
}
}

/*
Expand All @@ -538,6 +546,13 @@ connected()
self endon( "disconnect" );

level.players[ level.players.size ] = self;

for ( i = 0; i < level.bots.size; i++ )
{
bot = level.bots[ i ];
bot BotNotifyBotEvent( "connection", "connected", self, self.name );
}

self thread onDisconnectPlayer();

if ( !isdefined( self.pers[ "bot_host" ] ) )
Expand Down Expand Up @@ -1181,7 +1196,7 @@ watchNade()
if ( timeSlow > 1 )
{
thread launchSmoke( lastOrigin );
self delete();
self delete ();
}

wait 0.05;
Expand Down

0 comments on commit dfb4fd6

Please sign in to comment.