Skip to content

Commit

Permalink
waittillframeend event
Browse files Browse the repository at this point in the history
  • Loading branch information
ineed bots committed Mar 12, 2024
1 parent 8a15244 commit 13b5267
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion maps/mp/bots/_bot.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
init()
{
level.bw_version = "2.1.0";
level.bw_version = "2.2.0 PR 1";

if ( getcvar( "bots_main" ) == "" )
{
Expand Down
12 changes: 11 additions & 1 deletion maps/mp/bots/_bot_utility.gsc
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,22 @@ BotStopMoving( what )
}
}

/*
Waits till frame end so that if two notifies happen in the same frame, the other will not be missed.
*/
BotNotifyBotEvent_( msg, a, b, c, d, e, f, g )
{
self endon( "disconnect" );
waittillframeend; // wait for the waittills to setup again
self notify( "bot_event", msg, a, b, c, d, e, f, g );
}

/*
Notify the bot chat message
*/
BotNotifyBotEvent( msg, a, b, c, d, e, f, g )
{
self notify( "bot_event", msg, a, b, c, d, e, f, g );
self thread BotNotifyBotEvent_( msg, a, b, c, d, e, f, g );
}

/*
Expand Down

0 comments on commit 13b5267

Please sign in to comment.