From fc24a8c6b64f777a5a5e4da086c90a81ed1d1a35 Mon Sep 17 00:00:00 2001 From: ineed bots Date: Tue, 12 Mar 2024 15:03:42 -0600 Subject: [PATCH] waittillframeend events --- maps/mp/bots/_bot_utility.gsc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/maps/mp/bots/_bot_utility.gsc b/maps/mp/bots/_bot_utility.gsc index f3d9f70..a5aa324 100644 --- a/maps/mp/bots/_bot_utility.gsc +++ b/maps/mp/bots/_bot_utility.gsc @@ -790,12 +790,22 @@ botStopMove2( 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 ); } /*