diff --git a/maps/mp/gametypes/_bot.gsc b/maps/mp/gametypes/_bot.gsc index ddaf404..b75e180 100644 --- a/maps/mp/gametypes/_bot.gsc +++ b/maps/mp/gametypes/_bot.gsc @@ -181,8 +181,11 @@ init() if ( !isdefined( game[ "botWarfare" ] ) ) { game[ "botWarfare" ] = true; + game[ "botWarfareInitTime" ] = gettime(); } + level.bot_inittime = gettime(); + thread fixGamemodes(); thread onPlayerConnect(); thread bot_watch_planes(); @@ -236,6 +239,21 @@ handleBots() } } +/* + When a bot disconnects. +*/ +onDisconnectPlayer() +{ + self waittill( "disconnect" ); + waittillframeend; + + for ( i = 0; i < level.bots.size; i++ ) + { + bot = level.bots[ i ]; + bot BotNotifyBotEvent( "connection", "disconnected", self, self.name ); + } +} + /* When a bot disconnects. */ @@ -253,6 +271,14 @@ connected() { self endon( "disconnect" ); + for ( i = 0; i < level.bots.size; i++ ) + { + bot = level.bots[ i ]; + bot BotNotifyBotEvent( "connection", "connected", self, self.name ); + } + + self thread onDisconnectPlayer(); + if ( !self is_bot() ) { return;