waittillframeend event

This commit is contained in:
ineed bots 2024-03-12 14:54:39 -06:00
parent 8a15244813
commit 13b52670ed
2 changed files with 12 additions and 2 deletions

View File

@ -6,7 +6,7 @@
*/ */
init() init()
{ {
level.bw_version = "2.1.0"; level.bw_version = "2.2.0 PR 1";
if ( getcvar( "bots_main" ) == "" ) if ( getcvar( "bots_main" ) == "" )
{ {

View File

@ -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 Notify the bot chat message
*/ */
BotNotifyBotEvent( msg, a, b, c, d, e, f, g ) 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 );
} }
/* /*